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"

Can't set a variable from array length

Hi all! I recently started using blueprints in UE and I'm using some videotutorials to wrap up some ideas and functionalities with the purpose of learning an improving, but I've got a problem. I'm trying to read the array length created from "Get All Actors Of Class" node and then put the array length into an integer variable, setting this way the new variable value. The problem is that the variable doesn't get updated, so even if i have 15 same actors in the map, the variable maintains the value of 0 instead of being set to 15...and I can't understand why this is happening!alt text

Product Version: UE 4.18
Tags:
array-issue.png (87.6 kB)
more ▼

asked Nov 12 '17 at 02:53 PM in Blueprint Scripting

avatar image

Lacrima
5 2 3 6

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

1 answer: sort voted first

Where is the Construction script, perhaps it fires before everything else. Print text the length value and see what it says.

more ▼

answered Nov 12 '17 at 04:04 PM

avatar image

Everynone
15.2k 77 25 62

avatar image Lacrima Nov 12 '17 at 05:26 PM

I just moved the nodes in the event graph after an "Event Begin Play" and then it works in the right way. Probably the problem was really the fact that Construction Script fires before everything else, the thing is that in this videotutorial I'm viewing the guy just dropped those nodes there and for him no problem popped up. Maybe is something version-related? Surely he was not working on 4.18...

avatar image Everynone Nov 12 '17 at 06:31 PM

It is quite likely, yeah!

(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