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 do I create and attach a static mesh component to an actor from an actor component blueprint?

I'm inside a blueprint actor component, that has been added to an actor. From this component, I'd like to create a static mesh component and add it to the actor. However, no matter what I do, I can't seen to be able to call the function to create a static mesh component. The same thing works fine from within a blueprint actor (not component.)

For example, I've tried getting my owner actor, and then try to find the "add static mesh component" function on that actor reference, but that function doesn't show up (even with "context sensitive" turned off.)

Product Version: UE 4.11
Tags:
more ▼

asked Apr 25 '16 at 11:53 PM in Blueprint Scripting

avatar image

jwatte
1.3k 48 41 88

avatar image HaxO Apr 26 '16 at 12:15 AM

It was a long time ago, but I remember reading something about child BPs not having access to some parts of parent BPs functions. May have to dig into C++ a bit to make it accessible.

avatar image imskull May 16 '17 at 04:54 AM

It is impossible, you can not use AddStaticMeshComponent to add a child component in a component blueprint. use Child Actor Component instead.

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

1 answer: sort voted first

Here is the trick I used:

I created my actor component to be a child class of InstancedStaticMeshActorComponent. This way you will have access to a mesh component in your actorComponent. You can set its static mesh and material then you need to call addInstance onto self inside the actorcomponent code. Once everything is setup as you want, you just need to call attachToComponent on self.

Here is a capture of my code to make it more clear: https://blueprintue.com/blueprint/ebygofen/

more ▼

answered Jan 30 '19 at 12:26 PM

avatar image

thebenjiman
66 1 6 5

(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