Question by
hukado · Dec 25, 2019 at 01:29 AM ·
instantiateobjectassign-variable
Assigning instantiated object assigns other object instead
Hi. I have this following piece of code,
if (up == null)
{
up = Instantiate(PlaceholderPrefab, transform.position + Vector3.up, Quaternion.identity);
AdjacentRooms++;
}
but instead of instantiating a new object and assigning it to the variable up, it takes a random object in the general area that it should be instantiated and assigns that to the variable instead.
Any idea why?
Comment