Possible to have physics but still pass through some objects?
by Jacob Wagner · in Torque Game Builder · 07/26/2005 (6:16 pm) · 3 replies
Hi. I noticed that if you turn physics on for an object, it seems to bounce/collide/get rotated from any other objects that are around, regardless of collision masks.
So is it possible that with some objects my object would just pass through it, instead of reacting to it with physics? Or is this a planned feature?
*edit
I figured out that if I used %NPC.setCollisionActive( false, false ); then I would pass through the object,
but what if I want to still cause a collision(not a physics collision response but a regular collision callback) but I dont want the object to bounce off physically?
I tried setting :
%NPC.setCollisionActive( true, true );
%NPC.setCollisionPhysics(false, false);
but this still causes the object I turned physics on for to bounce off of it.
So is it possible that with some objects my object would just pass through it, instead of reacting to it with physics? Or is this a planned feature?
*edit
I figured out that if I used %NPC.setCollisionActive( false, false ); then I would pass through the object,
but what if I want to still cause a collision(not a physics collision response but a regular collision callback) but I dont want the object to bounce off physically?
I tried setting :
%NPC.setCollisionActive( true, true );
%NPC.setCollisionPhysics(false, false);
but this still causes the object I turned physics on for to bounce off of it.
#2
If anyone is interested, for example, in making physics work between 2 objects, but then allowing an object to pass over a third object, but still allowing collision responses (non physical) between the first object and the third object, here is what I did:
RESULT: Player pushes block around but player affected by block. Npc+Player, collision but no physics.
07/26/2005 (8:35 pm)
I finally figured it out, seems I didn't quite understand the documentation and what the true, false things really did. If anyone is interested, for example, in making physics work between 2 objects, but then allowing an object to pass over a third object, but still allowing collision responses (non physical) between the first object and the third object, here is what I did:
$player.setCollisionActive(true, true); //collisions are sent to others collisions received $player.SetCollisionPhysics(false, true);//sent collisions not fed into physics system received collisions are %block.setCollisionActive( true, true );//collisions are sent to others, collisions are received %block.setCollisionPhysics(false, true);// sent collisions not fed into physics received physics are %NPC.setCollisionActive(false, true); //collisions not sent to others, collisions received %NPC.setCollisionPhysics(false, false);// sent collisions not fed into physics, received collisions not fed
RESULT: Player pushes block around but player affected by block. Npc+Player, collision but no physics.
#3
07/27/2005 (1:05 am)
Thanks for posting that, I had been having a similar problem and hacked around it manually, this makes it a lot easier.
Associate Ray Gebhardt
http://www.garagegames.com/mg/forums/result.thread.php?qt=27374