Teleport as player action

I’m looking to make a function for my player object that it can activate anywhere on the map. I have a game level with a narrow ground plane and cubes as obstacles. It’s really hard so I wanted to implement a teleport function with a timer limitation. So if the player object is stuck they can activate the teleport and ‘jump’ past the obstacle.

The problem is I can’t figure out how to get the camera to teleport with the player so it breaks my game at the moment. I’ve tried a few different ways to do this, the most successful of which has been to put a stationary teleport point past the most common problem areas. This doesn’t really fix anything though just changes the game so its not as hard. I’d really like to get this thing working. Any ideas?

Thanks for the Help :slight_smile:

Hi.

You could use the tansform.Translate function on the camera.

What you do is create a trigger object. Put an OnEnter trigger on that object that sends a message to the camera (and player) call their transport(location) function. To be clear you would put the transform.Translate function inside the transport function (and pass it the location you want to go to).

Hope that helps.