I'm still trying to get the hang of Box2d so this may be an obvious one.
So I'm trying to make "teleporters" that when an object hits one of them, the object is transported to the teleporter's partner teleporter.
I set up a body as a sensor and added an if statement in the Contact Listener to look for when an object hits the sensor. That all works fine.
The problem is that when I try to set the XForm of the object that is hitting the sensor nothing happens. It returns true when I use the function
but its coordinates do not change.
I'm not really sure whats wrong there, but I'm thinking it would be that the world is locked.
(TL;DR: Making a teleporter, using contact Listener to set XForm on contacts. Setting XForm does nothing. Help.)
Any help on how to accomplish would be greatly appreciated.
So I'm trying to make "teleporters" that when an object hits one of them, the object is transported to the teleporter's partner teleporter.
I set up a body as a sensor and added an if statement in the Contact Listener to look for when an object hits the sensor. That all works fine.
The problem is that when I try to set the XForm of the object that is hitting the sensor nothing happens. It returns true when I use the function
but its coordinates do not change.
I'm not really sure whats wrong there, but I'm thinking it would be that the world is locked.
(TL;DR: Making a teleporter, using contact Listener to set XForm on contacts. Setting XForm does nothing. Help.)
Any help on how to accomplish would be greatly appreciated.