Hi, I’m fairly familiar with static mesh actors and blueprint comms in general but I’ve never had to mess with AI or really any form of skeletal mesh before so I’m probably missing something obvious.
Here’s my problem: I have a model of a tool that has some moving parts, it isn’t very complex and I’d rather not mess around with creating a full npc for it as it doesn’t need to be that complex, and neither are the interactions, however the animation itself is fairly complex and I’d rather not hard-code it in an actor as a static mesh with translating vectors and so on. I’ve created the animations, imported them and set them all working in the animblueprint preview just fine.
All I want is the player to switch between the animations when they press a button on the HUD. I’ve tried setting up an Actor blueprint with a skeletal mesh blueprint inside it, I’ve got the HUD to talk to it, as shown below.
My cast fails when I try to use the event. Do I NEED to have the skeletal mesh in a character or pawn blueprint? I’d prefer to keep the class as an Actor if possible as it will make several other in game interactions far more complex if I need to start dealing with other blueprint types.
I would say you should have a look at Animation Montages and Animation Blueprints. You can create such an animation Blueprint including a state machine and then assign it directly to your skeletalmeshcomponent (so no, no character etc is needed, you only really need the skeletalmeshcomp).
And the casting fails because the anim instance is i.e. something like an AnimationBlueprint and not an animation directly.
Ok, I’ve already got an animation blueprint set up with a functioning state machine, seems like I’m missing the bit where I assign it perhaps? The animation blueprint is already showing the correct mesh in the preview window, so I thought it already was assigned. How do I cast to the animation blueprint? I seem to have hit a wall on that one. All I need to do is update the variables in the animation blueprint from the actor.
You can see the correct mesh in the preview of the AnimBP since the skeleton has a default mesh set
Now, lets say you have your Blueprint Actor where you want to have the tool inside. I guess you already added the SkeletalMeshComponent and assigned your SkeletalMesh. In the same window where you assign your SkeletalMesh to the component, just a few entries above, you have “Animation Mode” (select “Use Animation Blueprint” here) and Anim Class (Select your own AnimBP here).