Casting Blueprints Question

Hello, I’m just simply trying to get the location of an actor from within another actor.
This is my code. I’m specifically trying to get the location of three different ‘markers’ and set them into an array.

My casts are failing. How can I fix this?

Also, I have an error an unrelated error right here:

-Warning Make CustomMeshTriangle has no property tagged as BlueprintReadWrite. The node will be removed in a future release.

what does this mean and how can I fix this?

Hey Zectric-

Are the ‘marker’ locations all related to the same actor or are you trying to get the marker location of three different actors? One option would be to use the “Get All Actors of Class” node and connect it to a “ForEachLoop” node. From the Array Element pin of the loop node you then cast to the actor class you want to access. Keep in mind that the variable needs to be public (eye icon should be open) in the blueprint you are trying to access.

Cheers

They’re each their own individual blueprint classes. They just happen to have similar names.

What would I need to do to correctly cast them and fix the error?

Personally, I would use interfaces. However, that requires that you know and can get a reference to the target actor. If you can, then interfaces are so much easier, not to mention neater, than casting. I think of casting as more of a one off thing for something that you don’t ever expect to need to do again.

My personal best guess to do with the set up you have though would be to insert a set node (to a local var) in between each cast node, and then pipe them all into the struct with a get node. it may sound silly, but I have noticed weird things with the way UE4 handles chains like this, and for me, setting local vars has worked so much better.

To fix this I created a variable referencing to each of these blueprints and then I could get their locations.

According to this ( Make CustomMeshTriangle warnings - Programming & Scripting - Epic Developer Community Forums ) thread, it should be removed in a future update.