- Home /
Question by
MadJohny · Nov 27, 2013 at 04:16 PM ·
c#instantiateposition
Instantiate at original transform
Hi, usually when I instantiate it at transform.position, that will create the object at the object's position which instantiated it, but, is there anyway to instantiate the object on the position it was originally in, before turning it into a prefab? cause that would be extremely useful for what I need.
Thanks in advance.
Comment
Best Answer
Answer by Roland1234 · Nov 27, 2013 at 04:31 PM
A prefab stores its transform values as they were defined at the time the prefab was made. With a reference to the prefab in the script that's instantiating it, do the following:
Instantiate(prefabObject, prefabObject.transform.position, prefabObject.transform.rotation);