transform position not working on start() only on update()
I'm trying to change the position of an gameobject when the scene starts. If I change it in the function start () doesn't work but in the function update () yes it does.
gameObject.transform.position = new Vector2 (gameObject.transform.position.x,gameObject.transform.position.y+150);
What could be the problem?
Thank you.
EDIT: in OnEnable() function works good. I don't understand because the object is enabled when the scene is loaded so it would have to work in the start () function
Answer by Herschelx · Nov 19, 2018 at 05:59 PM
Ok, after hours and hours having the same problem, I finally figure out what caused it. NavMeshAgent is the culprit!!! Bottom line: use NavMeshAgent.Warp instead of transform.position
Your answer
Follow this Question
Related Questions
Start and Update dont work and checkmark for enabling/disabling script has disappeard 1 Answer
Script / Start() and Update() not being called 2 Answers
Where have the tutorials gone? 0 Answers
ontriggerexit/stay/enter not triggering on transform.position 0 Answers
How do I make a play button/main menu? 0 Answers