Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
Spawn random actor from array/tag/child actors?
Post Flair (click to view more posts with a particular flair)
Post Body

Hi!

I am a total noob and I am doing a tutorial about spawning actors and destroying actors (Make Games with Kate, tutorial 7 - Make a garden). In the video it teaches how to spawn an actor from one class with the press of a button, as well as destroy all actors of that class within the collision box. That I could do and understand. As an extra assignment it tells to make 5 different flowers, of which one is randomly chosen to be spawned when the button is pressed. This I can't seem to get to work.

My original flower is called Flower. The others are (very originally) BlackFlower, BlueFlower, RedFlower, Whiteflower. My attempts to do the randomization have been:

1: Make all other variants child actors of Flower. I then tried making an array of all child actors, shuffling and then connecting it to the Spawn Actor. No luck.

2:Made all flowers have Actor Tag of 5Flowers and tried using Get All actors with Tag -> Shuffle. But Spawn Actor demands a class, so the array of actors won't connect.

I have been at it for a while. Can someone point me in the right direction? How do I organize the flowers so that I can randomize which class is given to the Spawn Actor component? Thanks!

Author
Account Strength
90%
Account Age
4 years
Verified Email
Yes
Verified Flair
No
Total Karma
4,872
Link Karma
283
Comment Karma
4,123
Profile updated: 5 days ago
Posts updated: 2 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
3 years ago