Hello,
I’m working on a randomly generated level where the player hits an invisible object, random.range makes a number between 1 and 8, and then one of 8 prefabs is placed infront of the player. But for some reason I’m only getting 3 of those 8 prefabs.
Update:
I had a guitext show me the random numbers, its generating 1 through 8 after all but even if 5 shows up it chooses to spawn something other than 5, the same 3 prefabs keep showing up, this is really strange and I have no idea what could be causing this
there is definitely an error on your end somewhere… Just out of curiosity, why do you do it so complicated ( write so much repetitive code) instead of using a array?
thanks so much for the advice! Also I fixed my problem, it was really stupid, for prefabs 5 and above I copy pasted the names of the prefab variables so it just spawned 1 through 4 again. I feel really dumb now. If I just scripted more efficient code in the first place I would have never run into the problem.