- Home /
How to teleport player to gameobject
I have a two player platformer game put together kind of like the campaign in super smash bros. brawl, and I need to have it so when player 2 presses a button, it teleports Player 2 to Player 1s transform. I have looked all over and have found nothing on the subject of teleporting to 'specific' gameobjects. Can anyone offer any help?
Answer by Major · Jul 06, 2017 at 03:55 PM
transform.position = player2.position;
Store the other player position, and then move the current player to that position like you would any other situation involving player movement.
Answer by icecold043 · Jan 22, 2019 at 07:46 PM
Hey ! i know it's been a long time since but when i try this, it can't find my "TeleportPoint" gameobject, is it normal ? How can i get him to find the GameObject?
Can you please post your code and also use the "Add comment" option as well.
Your answer
Follow this Question
Related Questions
Is this how i do a Button activated teleporter. 1 Answer
Trying to make character move like frogger 0 Answers
Weapon Bullet Question - Steadily increasing sine wave 1 Answer
How do I modify the current transform? 2 Answers
spawn forward 1 Answer