Moving collision mesh not colliding
by Infinitum3D · in Torque Game Engine · 04/02/2009 (9:20 am) · 5 replies
I know this has been asked before in a dozen different threads, but there has never been a decent answer. Why doesn't a moving collision mesh register a collision. I know it should because the Player collision mesh moves and it gets detected.
I have a cube with collision mesh and bounds. I have an embedded animation that moves the cube, collision mesh, and bounds. When the cube is stationary, player collides with it. I have a script that initiates the animation using keyBind. I get player near the cube, press the 'animate' key and the cube passes through player, without colliding.
I have an echo in the cube's onCollision. It registers when not animated, but does not register with the animation.
Any ideas?
Tony
I have a cube with collision mesh and bounds. I have an embedded animation that moves the cube, collision mesh, and bounds. When the cube is stationary, player collides with it. I have a script that initiates the animation using keyBind. I get player near the cube, press the 'animate' key and the cube passes through player, without colliding.
I have an echo in the cube's onCollision. It registers when not animated, but does not register with the animation.
Any ideas?
Tony
#2
04/03/2009 (7:51 am)
Well, I think Torque just doesn't handle animated collision meshes. Collision is only checked by Players (for example) when the object itself is moving - not the collision mesh within the object. I don't know if ShapeBase or StaticShape objects do active collision at all - they just provide information for other objects to collide against.
#3
If my cube is moving (using an animation sequence to rotate), and my player is moving, shouldn't my player collision detection register a hit against the cube?
Tony
04/03/2009 (8:54 am)
Thanks Daniel.If my cube is moving (using an animation sequence to rotate), and my player is moving, shouldn't my player collision detection register a hit against the cube?
Tony
#4
04/03/2009 (10:50 am)
I don't have the specific knowledge to answer that question, but my tentative answer would be that the Player won't collide properly, if at all. Certainly, the collisions won't be stable or reliable.
#5
Still trying.
Thanks!
Tony
04/03/2009 (2:32 pm)
Well, I made progress. I scaled up Collision-1 to the same size as cube2 and rotated it in sync with the cube. My Player still doesn't collide with the cube but projectiles do. Projectiles collide while the cube is stationary and when the cube is moving. So Collision-1 registers while moving... Still not sure why Col-1 doesn't. Maybe it is an inherent bug to TGE, but I'm guessing its actually my collision mesh or my script...Still trying.
Thanks!
Tony
Torque Owner Infinitum3D
Could that be the problem?
I'm going to manually rotate Collision-1 using the curve editor and I'll give it the same settings as Col-1, and we'll see if that helps.
Tony