How to set up turn in place animations?

I am at a complete lost and I can’t find any tutorials on this matter, so I am hoping someone can help me out!!

At the moment, my character rotates left and right as I rotate the mouse left and right, which is fine, but I I need to be able to place a turn in place animation while he is rotating around (instead of just sliding in place). Any ideas?

In case anyone was wondering, here is a way to do it. There is probably a better way, but this is how I figured it out.

-Create float a variable in character blueprint, name it “turn value”, and set it to “Get Turn” (right click on an open space to get to it - its a custom node in unreal that gives you the value of where you are turning). Connect this to your :input axis turn)

-In your animation blueprint, call your “turn value” (from your cast to the character blueprint) and set it to a new variable in your animation blueprint. Name it “is turning?”

-Set up your animation appropriately and in your transitions to, lets say, your turn left animations, you can do something like this…

Hey , would you be able to provide a screenshot of your connection setup for the Character BP section. I’m following your directions, but am having trouble understanding the correct node and placement of them for them.

George

Hey George,

Here are the other parts of my set up. Warning though, there are better ways to do this (especially when considering multiplayer) but that is beyond me! Hope this helps!

Thanks . I found your other post on Braindrain85’s post regarding the same thing, but targeted towards multiplayer. My end goal is multiplayer so I suppose I will need to have it set up properly, but I need a starting point. I replicated all the things that he had posted in his video and it was still not showing the animations, but I hadn’t done this input axis part that you just posted yet. Hopefully this will work. Thanks for the help too, and I’ll report back if I can get it working.

George

Cant find Function “GetTurn”… using UE4.10.1 … please help

Nevermind found it. Was looking in wrong BP and was looking for function “GetTurn” but when I searched for “Turn” I see it.

Hello,

I have the same problem with my running animation? I would like it to be played in place and not with rollback. How could I do this?

Thanks for you help!

It worked for me, but how can I set it to have also turn right animation as well ? thanks

Turn for the opposite direction you should just change the test “IsTurning > 0” to “IsTurning < 0”.

Yeah I did it, it didn’t worked. Also, any idea to make it to turn in place with Wasd keys instead of mouse movement ? Like the character would turn in place 90 or 180 whit the animation when pressing wasd ? Thanks

Or should I use rootmotion to do it ? I haven’t find a clear tutorial on this yet

Let me try to help you, even though I don’t like solution so much, I think it’s better to do with a blendspace.

You need to have two animations “TurnLeft” and “TurnRight” and set up Axis Mapping for “Rotate” where “A” key will have 1 value and “D” key will have -1.

In the second picture instead of the “InputAxis Turn” node you will use the one that you just created “InputAxis Rotate”, please be aware that it shows two graphs one in your character event graph and the other in the animation blueprint event graph.

In your animation graph you will create a state machine that should be as follows:

Transition Logic should be { ‘IsTurning’ > 0 and ‘Speed’ == 0}

Entry > Idle [transition]> TurnLeft (play your “TurnLeft” animation in loop)

Entry > Idle [transition]> TurnRight (Play your “TurnRight” animation in loop)

Transition Logic should be { ‘IsTurning’ < 0 and ‘Speed’ == 0}
This should work, hope this helps.

(Formating is painful)

Yea, that’s one way to do it.

Create a graph from -1 to 1, divide in 3 pieces.
Set up: TurnRight at -1, Idle in 0 and TurnLeft in 1.

Feed you AxisValue as the parameter.

In your state machine you just create a logic to check that the speed is zero and IsTurning is different from 0, that way you don’t need two nodes in your animation state machine.

Just Idle and Turning.

Hey thanks, how would you do it with a blend space ?
Simple by adding turn left and right animations in a 2d blendspace ?

I really appreciate your help, thanks. I am very new tho, and I’m not sure to understand correcty.
Would you agree to show me your graphs and blendspace to set it up ? Knowing that my character also need to walk. Right now I have a decent walk whit a 1d blendspace. But I hate the way my char turns when I press A or D while being idle or walking btw. Because my character will be very slow, I would to set a system that make him play a turn animation even when he is walking. And never straff or walk in other axes than straight forward.

(Also *turn in place while walking I mean make a turn animation while pressing W + A or D or S + A or D instead or straff or just change axis abruptly like right now)

I don’t have a system like that setup yet, you see I’m trying to find a solution as well, my intention is to make a MMO like movement (WoW-like with turn in place / strafe / move forward and backwards only), keeping it really simple.

The type of movement and animation blending you are looking for depends on the type of game you are trying to make.

From your description, I think you are looking for some complex system.

If you want some AAA stuff you should consider acquiring: ALSv3

It’s not simple to learn or implement and it’s heavily tied to unreal skeleton, I don’t recommend to someone that new to unreal too, but it gives many insights on how to archieve things.

You may consider learning more of blendspaces (not the 1 dimensional kind), animations offsets and additive animations.