Projectile gravity?
by Tyler Slabinski · in Torque Game Engine · 12/20/2009 (1:03 am) · 22 replies
I am trying to implement a grenade into my game. It works fine, it has a timer, bounces, and does what it's suppose to. The problem is the projectile (grenade) glides too much, and isn't heavy enough.
I tried changing the gravityMod variable from 0.3, to 1, to 10, to 1000, and it makes no difference. I even tried adding a mass variable, but it still doesn't work!
I tried changing the gravityMod variable from 0.3, to 1, to 10, to 1000, and it makes no difference. I even tried adding a mass variable, but it still doesn't work!
#22
It probably is quite CPU-intensive, but you'd have to test to see how badly it affected your game. Otherwise I'd suggest the Item class, which has a semblance of realistic physics - not full rigid-body, but more than Projectiles are designed to have.
12/22/2009 (6:57 pm)
Heh, have a look at the RigidShape class. There's a resource here with an example datablock - the resource was later assimilated into the engine. TGE uses rigid physics for Vehicles mainly, but that functionality was modded into a generic rigid-body class.It probably is quite CPU-intensive, but you'd have to test to see how badly it affected your game. Otherwise I'd suggest the Item class, which has a semblance of realistic physics - not full rigid-body, but more than Projectiles are designed to have.
Torque Owner Tyler Slabinski
How can I make the grenade have a rigid-body? And would it take alot of CPU power? I am making an iPhone game, so CPU power is a heavy variable in how I make my game.