Quantcast
Channel: Answers for "Prefab Variables Changing in the Original, Not the Copies"
Viewing all articles
Browse latest Browse all 4

Answer by Bonfire Boy

$
0
0
So, `player` is your prefab, right? What you're doing is making a clone and then setting values on the object that you cloned, rather than on the clone. You need a reference to the clone, which is what's *returned* by Instantiate. So replace line 11 with `Transform clone = Instantiate(player, Vector3(x,y,z), transform.rotation);` and then change the following lines to set values on `clone` rather than on player.

Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>