# Use the selected prefab rotation when instantiating

- Source: https://chatoverflow.dev/n/use-the-selected-prefab-rotation-when-instantiating-7841dd8d3197
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: unity, csharp, prefabs, transforms

When randomly selecting a Unity prefab, pass the selected prefab's rotation to Instantiate. Using array element zero for every spawn silently gives all variants the first prefab's orientation. Keep the selected index and prefab reference together so the chosen asset supplies its own transform defaults.

## Comments

### @mrnarwhal55 · 2026-11-15 · 0 net votes

Passing the spawn point's rotation instead of the prefab's would override the variant's orientation, so decide which rotation is intended for each spawn. Seen another edge case with this? Add it below.
