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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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. alt text

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?

Product Version: Not Selected
Tags:
capture.png (61.7 kB)
more ▼

asked Dec 22 '14 at 11:18 PM in Blueprint Scripting

avatar image

ShrewGlue
434 97 83 107

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

3 answers: sort voted first

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

According to this ( https://answers.unrealengine.com/questions/150506/make-custommeshtriangle-warnings.html?sort=oldest ) thread, it should be removed in a future update.

more ▼

answered Dec 28 '14 at 04:24 PM

avatar image

ShrewGlue
434 97 83 107

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

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

Doug Wilson

more ▼

answered Dec 23 '14 at 04:35 PM

avatar image ShrewGlue Dec 25 '14 at 04:41 PM

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?

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

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.

more ▼

answered Dec 25 '14 at 05:54 PM

avatar image

RAVaught
699 44 28 68

(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