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"

How can I get the mesh my anim blueprint is attached to?

I've got an anim blueprint that's on the mesh of an enemy character. I'm trying to spawn a projectile off the socket of this character, but I don't know how to get a reference to the mesh from within the anim blueprint. How do I do that?

Product Version: UE 4.10
Tags:
more ▼

asked Feb 05 '16 at 03:32 PM in Blueprint Scripting

avatar image

summitch
13 2 4 8

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

3 answers: sort voted first

I assume you can use "Get owning actor" and from there on you can cast to the appropriate blueprint class. Is that gonna work?

more ▼

answered Feb 05 '16 at 04:38 PM

avatar image

Jonas_Molgaard
496 30 25 48

avatar image summitch Feb 05 '16 at 05:06 PM

Owning actor doesn't refer to the Mesh that the blueprint is attached to (which is surprising). See my answer for the way to get the Mesh.

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

I figured it out. It turns out that the owner is the actor that owns it and you have to use "Get Component By Class" and choose "Mesh." In my case, there's only one mesh, so that makes things easy. Otherwise, you'd have to go through the array and identify which mesh you want.

I'm surprised that there isn't an equivalent to "get owner" that gets the mesh the anim blueprint is attached to. If there is, please let me know.

more ▼

answered Feb 05 '16 at 05:06 PM

avatar image

summitch
13 2 4 8

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

I may misunderstand something, but you try to get the mesh of your pawn right? In that case, make sure to cast your "Owning actor" to your appropriate class, that cast node will get you the specific type, which if you drag out from that, will get you a reference to "Mesh". I've attached a screendump. So correct me if im wrong, and that's not what you wish to achive. alt text

untitled.png (53.2 kB)
more ▼

answered Feb 06 '16 at 11:48 AM

avatar image

Jonas_Molgaard
496 30 25 48

avatar image Arty-McLabin 5 days ago

Few notes about this approach:

1) it is better ran on initialization only, and get set to a variable that will later used, rather than using it every tick (for performance sake)

2) it will not work if the mesh has no actor, so be cautious.

(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