2.5D Character Rotation

I am currently attempting to create a platform fighter in a similar vain to Smash Bros. and I have been fidgeting with turning the character in a number of ways. I am wanting to do a full Turn when the input requires.

  1. I don’t want to use the Character Movement’s Orient Rotation to Movement as this allows for the rotation to stop mid turn.

  2. I have tried an Animation Montage with Root Motion but Root Motion as far as I know does not use the Character Movement velocity so it halts all movement and looks bad. I would also like to carry the character momentum a bit when turning fast so this prevents that as well.

  3. The current method I am doing is via a Timeline but I have concerns with what happens when the player gets hit mid Turn as the Timeline doesn’t have an On Interrupted like the Play Montage does.

Any insight on better ways to handle such a thing would be very much appreciated. Thanks.

This is what I am using, currently to handle a similar situation. Right now this function is on the Event Tick, but it could easily be changed up to a “do while” loop if you like to keep your tick tidy.

Basically, the game is keeping the character’s Z rotation stored as “current rotation” on every frame, and checking if the current rotation is equal to the “desired rotation.” It then checks to see if the current rotation is within 1 of the desired rotation and, if so, sets it immediately (just because UE loves to leave lerps and interps at wild float decimals, and I wanted it to stay a clean number).

The connectors get pretty messy due to how I have them stacked up, but it’s basically using RInterpTo to incrementally set the character’s rotation closer and closer to the desired rotation “in the background,” so whenever you want to turn the character, you simply set the “desired rotation” variable and this event takes care of the rest. It should be mentioned that using this method with animations with root motion enabled would probably cause issues, but in those cases an easy workaround is to set the character’s rotation instantly before starting the animation.

Appreciate the reply I will give this a try! Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.