This project has moved and is read-only. For the latest updates, please go here.

Teleporting bodies

Topics: Project Management Forum
Feb 24, 2014 at 7:30 AM
Hi all,

I wan't to ask, what is the easiest and best way to teleport dynamic body to some location. I wan't true teleport, without any collision detection and stuff.

It seemed that simply setting Body.Position will be good, but there is a problem. If there is some physical obstacle between old position and new position, body won't make it through.
I hoped there won't be any collision detection when setting position manually.

Now I'm thinking about this approach:
  1. Change body type from dynamic to kinematic
  2. Update physical world
  3. Change position
  4. Update physical world
  5. Change body back to dynamic type
I'm not 100% sure it will work and it seems really clumsy. So is there any nice way how to do it?

And sorry for bad English.
Feb 26, 2014 at 8:13 PM
I'm dumb.
I had two bodies connected by joint and teleported only one of them.
Simple position change is enough (when applied to both bodies).