Making a parented prefab be 0, 0, 0, on its parent.
I have been having a lot of trouble with this lately so I figured I would just do this. I am kind of new to programming so the code is not very... good.
So when I press play the Prefab spawns but it does not go to 0, 0, 0, like i want it to. I am probably just doing something completely wrong and dumb but this has been bugging me for a few hours now. So please help me.
So far you have instantiated the gameobject and made it a child. You haven't set its position. If you want it to go to (0,0,0) in world space you would do:
childObject.transform.position = Vector3.zero;
or if you want it go be at (0,0,0) relative to the parent you would use:
childObject.transform.localPosition = Vector3.zero;
Btw, there is an overloaded method of Instantiate() that can set position & parent as well.
Your answer
Follow this Question
Related Questions
slow down certain objects 1 Answer
How to play audio when Time.timeScale =0 ? (see picture) 0 Answers
Unity 2D Build Error 0 Answers
my friend can't join my multiplayer game! 0 Answers
shader graph help 1 Answer