Game Development Community

Item Collision

by Harley · in Torque Game Engine · 02/23/2005 (1:19 am) · 2 replies

Hey,
I am trying to make of a bit of a simple pool/snooker game using Torque just to get me used to the engine a bit and I'm having some trouble with Item collision. What I currently have is if you walk the player into a ball (which is an Item object) the balls velocity is set to the players velocity. This works fine for the time being but the balls at first went through each other. So I added ItemObjectType to the collision masks in the engine, now they hit each other. But now the balls wont fall off ledges?! They just kinda float in the air, like the z axis is being ignored? Any ideas or suggestions on better ways to go about this? If im not being very clear let me know and I will have another go at explaining it ;-).

Thanks,
Harley.

#1
02/23/2005 (5:33 am)
I think items by default don't have physics. That's why you had to add support for collision. Instead of trying to modify item behavior, try using something that already has this stuff. Make your ball an aiplayer (no need for an AI to actually think). Then it will have normal collision and physics by default. I'm sure there are other, simpler objects that would also do the job (staticshape maybe), but I'm certain that aiplayer would work.
#2
02/24/2005 (2:53 am)
Thanks Eric. The ItemData has variables for mass, friction etc and I can call setVelocity and move the balls around ok. Its just when I have added the ItemObjectType to the collision flags it seems as if gravity isn't affected in regards to the z axis. If the balls hit terrain they will go up hills, just not down.