ForEachLoop doesn't set material
I'm trying to build a level creator system with a container that stores each object's data in a data container. The data stored in the data container (for now) is an reference to my actor and a location vector. This data is set when spawning in an object.
When I place an object, each object has a data manager that spawns and the data for each of the object gets set. When the 'marker' version of the actor is at the same location as the placed object it sets the material to not valid (as shown below). This is so you wouldn't be able to place multiple actors at the same location as the already spawned actor. The following screenshots are an example of 2 placed actors but only the most recently placed actor gets set to invalid.
The problem I'm having is, when the ForEachLoop runs to detect the locations of my objects, which is stored in the data container, it only sets the material to be invalid for the most recently spawned actor, when it should be doing so for all of the actors if the locations overlap.
NOTE: The strings that are printing are the locations of the two placed actors (in white). When I tested this the 'marker' actor location can be the same as an actor but it doesn't set the material to red.
asked Dec 10 '15 at 09:47 PM in Blueprint Scripting
Follow this question
Once you sign in you will be able to subscribe for any updates here