Here’s the challenge:
I have some 20 PlayerStart actors spread out over my level, some are tagged with “Walker” and some with “Glider”. When re-spawning I want to choose a random “Glider” start (when I’m gliding).
What I’m trying so far:
- When in GameMode or PlayerController, I’m getting all PlayerStarts with “Get All Actors of Class”.
- Loop through the array and check with “Actor Has Tag” if the tag matches. If so, I put the PlayerStart in a separate array
- Pick a random entry from said array
The problem that I’m having is that there are zero matches. And what’s causing the problem is that I don’t manage to read the Tag of a PlayerStart. Even when directly trying to read the tag, it says “not in scope”.
What am I doing wrong here?
(see below an excerpt of the GM function)