Forum
2019.03.25
Creating example func.
-
Create a method called SavePosition() to save position of game object when Button ‘S’ is pressed. Create a method called LoadPosition(), to get the saved position of the game object when the game is started.
Can you help me?
- Replies
-
And next time, please use a descriptive topic title (like "How to save and load object position?" in this case).
If you wanna save the position of target object, you can get some hint below.
if(s is pressed)
{
var vecter3 = gameobject.transform.position
or
var vecter3_x = gameobject.transform.position.x;
var vecter3_y = gameobject.transform.position.y;
var vecter3_z = gameobject.transform.position.z;
}
This is not perfect code but you can figure out how to do it.
Have fun, and welcome to AVATA!Enterprise 2019.03.25
