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"

ForEachLoop in Level BP doesn't change the variable in any Array Element

I will start by saying I am still very new to UE4 and coding in general so I am mostly sticking to Blueprints for everything.

I am trying to make it to where when you rotate the camera and overlap trigger boxes it sets the same variable on all of the "TownPush" Actors (there are around 150 in the world).

Here is the Overlap event in the Level BP: alt text

The actual TownPush BP just checks when clicked for the "Camera Angle" variable and then has it's physics enabled followed by adding a force to push it. alt text

Currently when I rotate the camera it doesn't change any of the variables in any of the BPs. All it does is stay at 0. Is there something I don't understand about loops? How could I get this to work?


Product Version: UE 4.20
level-bp.jpg (126.6 kB)
town-push-bp.jpg (103.6 kB)
more ▼

asked Dec 25 '18 at 09:51 PM in Blueprint Scripting

avatar image

1 1

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

1 answer: sort voted first

Turns out I had a failed cast right before the "Get all actors of class". That was preventing the Array from having anything in it.

I figured it out by first setting a keybind to print the length of the array. When that came back as 0 I put a breakpoint on the "Get all actors of class". It wasn't being triggered so I removed the other cast before it (which I no longer needed).

Not really an answer since what I was asking wasn't really the problem, that worked fine once the cast was removed.

The more you know.

more ▼

answered Dec 26 '18 at 03:08 AM

avatar image

1 1

(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