Position not correct Game 2D
Hello ! I have question ?
I move Player go to Door 1 and Change Scene to room 1 (Press E)
But when I left the room . Player at start point
I want to left the room . But Player at the front door (Door 1)
Thank you for help (^3^)/
Eng is Bad -*-
Hi,
First I will tell you the approach, hope this will help. but in case If you didn't get that then please let us know. I will post code for the same.
You have to do like.
When you go into any of the door, you need to set the state ( you can set enum ) and the position of the player . This will help you to remember to the code that of which door I'm going.
The state should be save in the script of Non-$$anonymous$$onobehaviour or with the dontdestroyonload() Because when scene switches from x->y ..the data should remain in the variable.
Now when you came back to the door & scene loaded (scene1) you should check the state in Awake() .. it will say that you have entered in the door one, because when you went into that door you have set the state & position. Now assign that position to the player.
Hope you may Get some idea what I was trying to say.
Sorry I was not able to explain properly. If you say I can also provide code for the same Thanks
Your answer
Follow this Question
Related Questions
CS0120 - Object reference required but it's already assigned. 0 Answers
comparing two gameobject 1 Answer
Game Object doesn't instantiate at Mouse Position 3 Answers
Transform Position is not moving the target 2 Answers
Assinging new coordinates (position) in Unity to imported assets/objects from Rhino 0 Answers