x

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"

get index from get all actors of class problem

Have a problem when trying to get index from get all actors of class, in array of 2 items,0 and 1, when 0 is picked up 1 automaticly changes to 0, is it possible for index to stay same? alt text

Product Version: UE 4.18
Tags:
1.png (364.9 kB)
more ▼

asked Nov 02 '18 at 08:49 PM in Using UE4

avatar image

darkok25
14 1 6

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

3 answers: sort voted first

I got it working with getting attached actors from A_BasePickUp

more ▼

answered Nov 03 '18 at 10:57 PM

avatar image

darkok25
14 1 6

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

Get All Actors of Class index is just result index, there no guaranty that each call gonna give you same index on specific actor and not mention there nothing that ties actors with your indexing.

So insted of using Get All Actors of Class all the time you should do just once, keep the array and use that for index. Or even better make A_BasePickUp Begin Play call GameMode to register it self to some array and on destroy also do call to remove it.

more ▼

answered Nov 02 '18 at 09:26 PM

avatar image

Shadowriver
37.3k 936 172 1117

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

The order of GetAllActorsOfClass may change each time its called. Depending on how you're setting index something like this may work:

alt text

more ▼

answered Nov 02 '18 at 09:34 PM

avatar image

Thorp
16 1 5 8

(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