Teleport physics body

Hello everyone

I wanted to know what the best way for you to teleport a physical body. 

if I did not have a physical body, I would simply change the coordinates, but with physics?

looking for I found this tutorial:  https://coronalabs.com/blog/2015/09/24/tutorial-creating-awesome-water-with-liquidfun-snapshots-and-filters/

The Freeze!2 video shows a good example of teleportation(about 0:20).

In the video it even seems that the physical body slowly moves to the portal piece by piece…

  1. So that is the best way for a teleportation?

  2. Then replicating that teletraspot effect “piece by piece” is complicated?

As you can do this with a non-physics object:

obj.x = 100 -- move object to x == 100

So too can you do this with physics objects that have either ‘dynamic’ or ‘kinematic’ bodies.  You must however keep these details in mind:

  • isSleepingAllowedshould be set to false, or the body may not move to the new position.
  • Moving a ‘static’ object may not work as expected.
  • Moving the body discretely (as shown above) will not push other bodies in the path of movement.

Note: At 0:20 in the video, the designer has actually done this:

  1. Found some way (of which I can think of at least two)  to mask the rendered object so it seems to enter a portal.  

  2. Created a second object that ‘comes out’ of the other portal using the reverse rendering trick.

I’m sure I could work this exact effect out, but not in a few minutes.  (Hitman)

The key takeaway here is, there are TWO objects representing a single object in that video. 

Final note.  If you are simply looking to create a screen wrapping effect (like asteroids), that is pretty easy.  

SSK 2 comes with a wrapping helper: https://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/actions2/#scene-wrapping-scene

Perfect thank you very much

I imagined that he had used two bodies for that effect but wanted an outside opinion before.

For teletransport better than expected if it is sufficient to move its coordinates.

I will test. if I can not, then I’ll use the hitman service

Good luck on this, and if you do use the Hitman service be sure to clearly define the specific teleport effect you want.  There is a lot of room for interpretation here depending on the visual effect you are trying for.

As you can do this with a non-physics object:

obj.x = 100 -- move object to x == 100

So too can you do this with physics objects that have either ‘dynamic’ or ‘kinematic’ bodies.  You must however keep these details in mind:

  • isSleepingAllowedshould be set to false, or the body may not move to the new position.
  • Moving a ‘static’ object may not work as expected.
  • Moving the body discretely (as shown above) will not push other bodies in the path of movement.

Note: At 0:20 in the video, the designer has actually done this:

  1. Found some way (of which I can think of at least two)  to mask the rendered object so it seems to enter a portal.  

  2. Created a second object that ‘comes out’ of the other portal using the reverse rendering trick.

I’m sure I could work this exact effect out, but not in a few minutes.  (Hitman)

The key takeaway here is, there are TWO objects representing a single object in that video. 

Final note.  If you are simply looking to create a screen wrapping effect (like asteroids), that is pretty easy.  

SSK 2 comes with a wrapping helper: https://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/actions2/#scene-wrapping-scene

Perfect thank you very much

I imagined that he had used two bodies for that effect but wanted an outside opinion before.

For teletransport better than expected if it is sufficient to move its coordinates.

I will test. if I can not, then I’ll use the hitman service

Good luck on this, and if you do use the Hitman service be sure to clearly define the specific teleport effect you want.  There is a lot of room for interpretation here depending on the visual effect you are trying for.