Hi everyone!
So I made a Blueprint Actor called “Spawn Berries” with three arrows, where in the Event Begin Play, spawns three random objects in each Arrow [screenshot01].
The problem is, that sometimes it repeats the same Object and I just want to be each arrow with a different object. Can someone help me?
(Note: I created four Functions: One to get the Arrows Location [screenshot02], the other three to spawn the object [screenshot03]).
Put the berry numbers in an array and then shuffle the array ( there’s a shuffle node ). Then just use a loop to pick the berry numbers out of the array. Each one only happens once
Oh, I’m going to try it!! Thanks !!
(Ah, I don’t need to change the colors, because they aren’t the same object/actor. The berries are actually Blueprints Actors too)
Okay I have a question!
The part of the Array which is a ActorClassReference, in my case the Red Berry is an actor, the Blue Berry is an Actor too and the Yellow one the same. So when I make the variable map, I just can choose one… So, how did you make it?
If I’m not mistaken, you have your class array variable type set up as Red Berry. That actually needs to be a class reference to Actor or Pawn or whatever your berry actors are. So if they’re just regular actors in this case, you need to change your array of “Class”. Change it’s “Variable Type” to “Actor” and then choose class. That should solve your problem I think.
Okay, sorry if I’m annoying but I found a problem:
So, when I move my Spawn Actor of the Berries and press Play, the Berries are in the middle of the map floating. I check out my Blueprint Code and it’s the same as yours… What could it be wrong?