Ivan3z
(Ivan3z)
November 25, 2022, 6:54am
1
I need to initialize a variable of a component.
Specifically I want to drag a mesh.
But the details disappear when I select the mesh.
I know that I can get a reference to the mesh from inside the component.
The problem is that my pawn has multiple meshes attached. And I want the component to work with all kinds of meshes. (skeletal and static).
That’s why I need to assign the mesh from the details panel.
How can I do it?
Any keyboard shortcut or something?
Thank you very much!!
For administrators:
You’re trying to set a mesh variable with a skeletal mesh. That’s not going to work.
Also, I don’t know if this would work in any event, as you’re trying to drag an instance onto a class setting. ( I’ve never tried it ).
2 Likes
Ivan3z
(Ivan3z)
November 25, 2022, 9:16am
3
Hi
Static mesh and skeletal mesh has a common parent class?
I assumed that the mesh component was the common parent… I really don’t know.
I would like to use polymorphism to do this.
At the moment I am using an interface.
Seems to work with static mesh… I’m going to test skeletal mesh now…
However if I could use polymorphism and drag the component to the details I would prefer that to using an interface.
Thank you for your comment ClockworkOcean!!
1 Like
Are you referring to blueprint inheritance or actual polymorphism ( which I know nothing about )?
I think meshes and skeletal mesh are just different classes ( I mean, they are both objects, but so is almost everything ).
Their job is totally different. It’s a bit like trying to combine a material and a blueprint, or something It might be better to have two slots. Just an idea…
2 Likes
Ivan3z
(Ivan3z)
November 25, 2022, 9:26am
5
What I have been able to test for inheritance and polymorphism in bluprints works the same as in C++.
OK, so if they don’t have the same parent I’ll have to do some adaptation… I want this component to work with any type of mesh.
Thank you so much for your help ClockworkOcean!!
1 Like
Ivan3z
(Ivan3z)
November 25, 2022, 10:03am
6
I found a common parent. For what I want (assign a material) I think it will be enough.
1 Like