You have to set the target in the inspector of the Object that has this graph
For teleportation. Should I just run into the object or just use it as a button.
For this one you have to put it on a object or button. I am currently writing one for a more advanced version
Let me know when it’s done so I can be able to use it with buttons or walking into the object.
You can already use this on buttons. Use the Interact method when setting up the button target.
OnDestroy is called when the scenes switches or the game is shutting down.
Best example for this would be when we get persistent storage, you’ll use this to make sure the data is saved as the user is leaving.
Value can also be synced, that way it will happen at roughly the same time for everyone.
Please note that this example will run every 5 seconds. If you want it to stop after the first time, either disable the gameObject this is on or add a bool check.
Player Settings with Collider for On Trigger event.
Using this set up, you can use the OnTrigger related stuff above and check if the name matches PlayerCollider and do something if that is detected (This detection is local)
I am trying to use your teleport code, but, it is not bringing me to the location I want the player to be teleported too. It is either throwing someone back a few yards or forcing someone into the door itself, the place where the collider is. I have a whole other room i am hoping to get people too.
So, can you explain in why the code is not sending anyone too the specific parameters?
And, what is vector 3 and can i change that at all?
You have to set a target in the Inspector window. There will be a field called “Target”, and you just drag the gameobject that’s in the position you want the target to teleport.
Hello, and i did that,but, it is just sending me away from the door itself. By just a few yards at most. Could it be possible to be out of range for a teleport?
You can teleport to the void if you want to. Screenshot what you got (graph and inspector)