Collision detection
by Ironbelly Studios · in Torque Game Engine · 07/28/2006 (6:07 am) · 2 replies
Hello everybody
i am new to torque and was trying to make a prototype using the TGE as per the instructons in the GettingStarted.pdf but i am stuck at some point for which i need your kind help
i had made a terrain and put a player and a tommygun in it
but now when i go through it the player is not picking up the gun
can anyone suggest me some ideas how i can make the player pick up the gun
both the files are in .dts format
help much appreciated
thankin you
i am new to torque and was trying to make a prototype using the TGE as per the instructons in the GettingStarted.pdf but i am stuck at some point for which i need your kind help
i had made a terrain and put a player and a tommygun in it
but now when i go through it the player is not picking up the gun
can anyone suggest me some ideas how i can make the player pick up the gun
both the files are in .dts format
help much appreciated
thankin you
About the author
#2
thanks for the guidance
since i am new to using TGE can u be more specific in telling how collision is implemented in torque?
and also where to check about the collision box? and if it si not there how to create one?
help much appreciated
thanking you
07/31/2006 (2:08 am)
Hi jonathanthanks for the guidance
since i am new to using TGE can u be more specific in telling how collision is implemented in torque?
and also where to check about the collision box? and if it si not there how to create one?
help much appreciated
thanking you
Torque Owner Jonathan Blair
there are 2 things you need to check when you want to pick up something. First is the collision of the objects, second is the pick up script.
If your using the items that come with torque (ie Kork and the crossbow) the collision part should be fine. If not, it is my experience that the gun does not have to have a collision box (I have several shields that do not) but the player does. Do a search for dts exporters and whatever modeling program you are using to find info on creating the required items for proper export.
As for the scripting, there are 2 ways to do it. The default way is to use the inventory system that comes with torque. Check out item.cs, inventory.cs and weapon.cs in the server\scripts folder of starter.fps and do a search for inventory system to get an idea of how it works. It can be slightly confusing at first but once you get it it is easy.
If all you want to do is pick it up, you can add a simple onCollision function to the weapon.cs file. Look at health.cs or do a search for the SuperBomb tutorials, it will give you an example of how to pick up an item
K