Teleporting the player?

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on Fusion.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Teleporting the player?

Sen
2022-04-12 13:45:57

Hello,

I am using Photon Fusion and my player is a NetworkCharacterControllerPrototype.

My game is set as a host+client.

When the player dies I change a NetworkedParameter which triggers a function with -

characterController.TeleportToPosition(newPosition);    

But nothing happens. I know for sure the function is running.

Is there a different way I should use to move the character to a set position?

Comments

Klover
2022-04-12 23:48:30

I don't be using character controller because I like to code pretty much everything from scratch, so I would've just said transform.position = newPosition;

Also make sure that you have the Photon Transform View component attached to your gameObject so that the position syncs for all clients. Not sure if it's different than PUN but that's how I would've done it.

Back to top