Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Disable Specific member in GetAllActorOfClass array

Hey everyone !

So, basically, what I'm trying to do is (I think) qutie simple. I have multiple "zones" where I can do actions in it (spawn an actor). Once I have exectuted this action, I want to disable the posibility to do the action again (prevent double spawning).

So the setup I have tried is I register an index for the zone, and when I overlap the zone, I set the ZoneIndex in my player pawn. Problem is, it is working, but the getAllActorOfClass does not seems to feed the array in the order the zone have been created, but rather a random order, so even with my fixed index, it disable interraction, but not for the current zone.

My question is, how would you manage this ?

Thanks for anyone who is able to help !

Product Version: UE 4.21
more ▼

asked Mar 27 '19 at 02:29 PM in Blueprint Scripting

avatar image

62 2 4 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hi you could use "do once" to avoid double spawning. The issue with "get all actors from class" is that they are random, to solve this issue you have to add the actors on spawn to an array, for example inside your Player controller.

more ▼

answered Mar 27 '19 at 02:39 PM

avatar image

1.4k 9 5 10

avatar image tbeaugelin Mar 27 '19 at 03:37 PM

Problem solved by making my own array, in order, instead of the randomness of GetAllActorsFromClass. Thanks for the input !

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question