- Home /
An instance of a prefab teleports to 0,0,0 at the start of runtime
I have tried the lazy quick fix of teleporting it to where I want every frame, that didn't work, I have an instance of a door prefab in the editor that appears to be at a reasonable height for a door, but as soon as I load in, the door is at 0,0,0, any ideas on how to fix this?
Answer by Capricornum · Sep 14, 2020 at 06:59 AM
That is impossible. You either have a script, which meddles with the doors position at Awake
or Start
. Or you set its position using a custom editor instead of the normal Editor. Which means that the position will not be serialized within Unity and saved for later.
Is the door a creation of your own or did you get it from the store? Maybe it's got some internal logic you don't know about?
If you cannot find the script responsible, try using an empty parent object. Drag the door inside. Within this parent object the door can have a position of 0, 0, 0. But now you can reposition the parent object to where you need it.
Your answer
Follow this Question
Related Questions
problem with make gameobject prefab 0 Answers
How to stop prefab from resetting its user defined reference variable 1 Answer
OVR Player Controller issuse with unity 5.5.0f3 2 Answers
How to convert gameobject into prefab at runtime? 2 Answers
Setting the m_PrefabInternal property using the SeriailizedProperty System 0 Answers