Rotate myCharacter Skeletal mesh based on speed of character

Posting this question again because my last post didn’t get any responses.

I’m trying to simulate a rolling ball in a side scroller camera view. Similar to how Samus rolls in ball form in Super Metroid. I don’t want to use the AddTorque method because our character is complex and switches to different modes for flight, diving etc. Our movement works fine but now I’m trying to figure out how to tie the mesh rotating to the speed of the character. I’d like the rotation speed to scale with the left joystick axis input OR the velocity of the player. I’m attaching screens of our character in a test environment and some of the movement blueprints along with the components of our character. Any ideas?

Current Movement Blueprints for Left/Right

Character Components

Desired Behavior

Hi medicine,

Here is the solution that I came up with. I hope it works with your game mechanics. I’m sure you have already done these first few steps, but this is how to set it up exactly from the default template.

  • First off, I cleared the character mesh and animation from the Mesh component, then added a Static Mesh component of a ball.

  • Adjust the Capsule to fit.

  • In the Character Movement component, I made sure the Rotation Rate was all zeros.

  • Then I added this directly in to the 2D Sidescroller blueprint template.

  • Changing the -7 value will adjust the rotation speed. I found that -7 matches the standard movement speed fairly well.

  • Here is the Timeline that is running the rotation. It is just a 0 to 1 on a loop. This could also be replaced with a Timer and a Custom Event if you like.

I hope that helps. If you have any other questions about this, feel free to ask.

Cheers,

TJ

You are the man! I modified your blueprint a bit to better fit our current setup and it seems to be working just fine. I will do some more testing and get back to you with questions if something comes up. Thanks again!

Happy Holidays!

So I have run into an issue with this set up. Not sure why I can’t get the skeletal mesh of my character to rotate on the proper axis. Wondering if you could shed some light on the problem? Maybe it has to do with the way the model was imported? I’ve tried all 3 of the PITCH, YAW and ROLL settings. None of them rotate the mesh the way I want it.

Direction I want the mesh to rotate.

Current behavior!

The mesh is currently rotating like a spinning top instead of rolling on it’s side like a ball. I must be missing some small detail because this shouldn’t be that hard to achieve. Everything works correctly. Just on the wrong axis. HELP!

Are you making sure to rotate the Capsule Component and not the mesh? As long as the mesh is a child of the capsule then it should follow it’s rotation no matter how it was imported.

If you like, feel free to upload the .uasset for the mesh and character so I can test them. If you’re not comfortable uploading them here, you can send them by private message on the Forums.

https://forums.unrealengine.com/

Hi medicine,

We haven’t heard back from you in a few days, so we are marking this post as resolved for tracking purposes. If you still have questions about this topic, please see my post above and then post back here.

Cheers,

TJ