Find a USkeletalMeshComponent in hierarchy

Hey all,

I have a WheeledVehicle with its standard inherited Mesh, On this mesh I’ve added some additional SkeletalMeshComponents.

The SkeletalMeshComponent have MorphTargets which I’m ok with setting these up my issue is
Finding the SkeletalMeshComponent in C++ in order to use the SetMorphTarget(TEXT(“morphName”), 1, true);

Can this be done from using

USkeletalMeshComponent* mesh = GetMesh();

Note: I had several morph targets in my main Mesh which was working fine but didn’t suite our game.
If I could only get the Vehicles Mesh sub SkeletalMeshComponents this would be awesome.

Cheers

I’m thinking of using multiple blueprint objects within my vehicle using the UChildActorComponent This is attaching fine to the Mesh component of the WheeledVehicle however I’m also having trouble setting the Child Actor Class.

I’m sure this can be done however I maybe approaching this in the wrong way.

You can use either FindComponentByClass (or GetComponentByClass)

Which will return first found component. Or use GetComponents to get components array and find the target component yourself:

This function also let you create array of components of specific class, in template version: