Getting all the static meshes in actor with actor component

Hi,

I’m building a actor component for actor, that gets all the static meshes from the parent actor. I want to have select menu of the actors meshes in the editor.

So far no luck. I tried in blueprint " get owner->get all static meshes" or “get owner-> get all static meshes”, but the end result is empty array. Is there way to get array of parent actors meshes.

I also tired to do it in C++, but I can’t figure out how to make actor component run function in editor.

I would love to have some help for this. In blueprint or c++, doesn’t matter…

How about this?

did try this, but did nothing. I added new function that can be called in editor, but nothing. When I print the string with owner name, it is empty.

hmmm, this is interesting. It works when you select the actor from world outliner and then select the component, but if you open the actor and then press the button, then it doesn’t work. I wonder is it even possible to work inside of actor. By the way, thanks a lot from your time!

Ok, this works in game, but not in the editor.

Ah, in editor…

I think components are a run time thing.

EDIT: I take that back. Just tried it, works fine.

319247-meshes.gif

No worries. I don’t get how you’re calling the ‘call in editor’ event from inside the actor…

If you have actor component and add it to the actor and the component has function that is set to “call in editor” you can use it in actor also. For example you can have string variable in component and you can set its value with function that is attached to the button. But it can’t get the parent actor or actors meshes…

Ah, ok. It’s because there’s no instance of the BP. You’re trying to call a custom event when there is no instance.

Hmm…but why doesn’t it work even if I define the actor where it should get the meshes. I mean when you have the actor open.

Because you’re editing the class definition, not an instance - I think…