Question by
TheSaviour · Jul 11, 2016 at 06:06 PM ·
rotationinstantiateprefab
How do I set a transform to a prefab?
In my scene, Prefab A is instantiated every second and it moves at a certain speed. I'm trying to create a copy of this prefab that will be instantiated just like Prefab A. Let's call this copy "Prefab B". Prefab B will be instantiated just like Prefab A and it will move at the same speed at Prefab A. The only difference is Prefab B will move at a different angle. If I set the rotation of Prefab B, it doesn't have any effect.
How can I create a copy of a prefab such that it is instantiated at a different angle?
Comment
Answer by tanoshimi · Jul 11, 2016 at 06:15 PM
It's the third parameter you pass to the Instantiate method:
Instantiate(prefab, new Vector3(0,0,0), Quaternion.Euler(10,0,0));
Does this cause the prefab to be instantiated at 10 degrees about the x-axis?