1.13 Objects are moved instead of stationary?
by Gina-Marie -Netjera- Hammer · in Torque Game Builder · 02/04/2007 (4:38 pm) · 3 replies
Hi, this is the funniest error I've ever seen, and I think it might be some sort of physics bug. I have a map, and a ship that rides on the map as part of a level selection process. The map depicts several islands the player can travel to. In an effort to make the islands "solid", I duplicated one of them, and overlaid it on the background graphic as a sprite, then enabled collisions in "Clamp" mode. I was hoping the ship would bump into the island and stop. However, the ship actually *pushes* the island! I'm pretty sure this shouldn't be happening, because it means that any t2dStaticSprite created and overlaid on the level won't be stationary at the position where it's created.
Anybody have any thoughts? Bug or feature I'm missing?
Anybody have any thoughts? Bug or feature I'm missing?
About the author
Art, Games, Life www.netjera.com See my in-progress website and game design work at: www.netjersoft.com!
#2
02/05/2007 (12:05 pm)
Thanks, but that doesn't help. When i click "immovable", he travels under it. I did determine that physics wasn't enabled for the ship, and if I disable physics on the island and enable it on the ship, it works better. However, there seems to be an odd issue where if the ship hits the island at a particular point, it "teleports" to the starting location now. O.O
#3
Both objects should also have collisions turned on, but only the one responding to the collision need to have a callback or a response (the island, for example would have a NULL or 'empty' collision response, in that it does not do anything)
As for the 'teleport' issue, not really sure where your 'starting location' is, but this may possibly have something to do with 'damage' code or 'respawn on death' code that you have implemented (ie; your ship is handling the collision with the island as damage, then is 'dead', then 'respawns' -- verify your code by going through the life-cycle of a collision line by line ...
02/05/2007 (2:19 pm)
@Gina, physics in TGB are quite interesting -- both objects in a collision must send physics data -- the thing is, the object colliding, which should respond, has to both send and recieve physics, the object being collided into should simply send physics, and not recieve them.Both objects should also have collisions turned on, but only the one responding to the collision need to have a callback or a response (the island, for example would have a NULL or 'empty' collision response, in that it does not do anything)
As for the 'teleport' issue, not really sure where your 'starting location' is, but this may possibly have something to do with 'damage' code or 'respawn on death' code that you have implemented (ie; your ship is handling the collision with the island as damage, then is 'dead', then 'respawns' -- verify your code by going through the life-cycle of a collision line by line ...
Torque Owner Gary Preston