Hi there,
I’ve come across a weird problem.
I created a new class based on the Pawn class - Let’s call this Class A.
To this class, I’m adding upon construction a few child actors of a different class (the class actor that I want to attach as a child is made mostly of a widget) - Let’s call this Class B.
However, these Class B actors don’t appear in the viewport of the parent actor (A)… Even if I compile, and even during game play.
The weird thing is that if I simply open an actor from Class B (just open in the editor, without compile or anything else), it will now show in the actor of Class A, both in the viewport and in game play (once I compile, or hit play).
Super weird - can’t figure out why, or how to approach a solution/walk around.
Any ideas?
Thanks,
Have you tried to use that class b as a child actor of the class just adding it as a component instead of using the constr script?
Yes. With that it adds fine (B is showing without a problem).
The thing is that I need a dynamic system - I use references from Class A actors (that change from actor to actor) to attach the relevant child actor from Class B. That’s why I’m using the constr script (going over all components in the actor, and based on the results, I create and attach the relevant child actor).
try to use event begin play instead of constr. You keep it dynamic but you do it at runtime
Acts the same thing.
I think the issue is from a LowEntrey plugin I use (Extended Standard Library) - LE Extended Standard Library in Code Plugins - UE Marketplace
Although I give it the correct path, it just doesn’t “find” the class until I open the actor in the editor.
Is there a better way of doing this? Adding an actor just based on its name?
Okay - seems like I’ve fixed it.
Used another node that takes the original string with the path and converts it into “Asset Long Pathname” (name of the node: “Make StringClassReference”).
And it’s still all in the constr script which allows me to edit the A class easily (with child actors dynamically loads).
Thanks for the quick replies!
Actually - my bad. Not fixed because of Make StringClassReference…
What actually fixed it (which is a bad solution) is that I added nodes of Open Asset (something that is for use in tutorials) assigned to the actors I’d like to add - it is not connected to anything, but was enough for the editor to be able to locate the assets and create the actors.
Is there a more generic way to make the editor / game be aware of all existing actor classes (at begin plan / constr)?
try with get all actors of class