Game Development Community

Collision between a Projectile and a StaticShape

by Liu Yi · in Torque Game Engine · 01/03/2007 (6:12 am) · 2 replies

In my game, I find that when a Projectile object hit a StaticShape object, the onCollision function of the ProjectileData is called, but the onCollision function of the StaticShapeData is not called.

Why does this happen? Is it normal? Anyway to solve it?

#1
01/03/2007 (8:35 am)
Use the damage function call on the staticshape instead.
ex. function mystaticshape::Damage(%this.%obj,%col,%pos,%damage,%type)
onCollision on staticshapes only works for shapebase types if i'm not remember wrong.
#2
01/03/2007 (9:05 am)
To further explain why, there is a mask in the engine code that states what objects collide with StaticShape. Not to mention that StaticShapes have no velocity, which is critical for Torque collision.