Skip to main content

Search

Teleport an object, but only the x position.

  • OgTheEnigma

    You might be able to achieve this with just a follower. Let's imagine you're setting up the 'teleport' to the left side of the screen. Make an invisible, non-collidable, block and place it on the left side in the relevant x-axis position. Place a tag on it called 'left'.

    Now put a Follower on the object you want to move. Make it follow the 'left' tag. Set the Follower to a really high speed with 100% strength and damping, and movement only in the x-axis. When it's activated it should be fast enough that it essentially looks like teleporting from the player's perspective.

    You'll have to test the find out the optimum time to keep the follower active when the object needs to be 'teleported'. At first test it for 0.1s at the maximum possible distance. If it doesn't move the object far enough, then increase the time to 0.2s and so on. The follower should be able to move very fast, just make sure no other movers are interfering at the same time.

  • Rabagast

    Hi!
    It's exactly what I tried to do and it works, but not 100 %. I can see the ship while it's moving. It's like blinking. And I don't want that. I tried to make the ship invisible while it's moving and make it visible again before it enter the camera view. But it takes to much time. Maybe 1-2 sec. I just wish it could be possible to teleport or just set position to a specific axis.

    This is very easy to do in Unity.

    I hope Mm can make it possible in the future.

  • merkaba48

    You're both so close. You want an invisible follower with zero X movement, and then teleport the object to that follower.

    i.e. say your object has "Teleportable" tag on it, and your invisible follower has "Left Target" tag on it.

    Left Target object follows Teleportable up/down on the left side of the screen.

    Teleportable teleports to Left Target when it passes the right side of the screen.

Please sign in to leave a comment.