Realistically, when a person is running, they lean into a turn. I want to replicate this in Unreal 4, but first I need to know how to detect when an actor is leaning.
What I theorized was to simply check every .1 seconds (or another variable of a second) and see if the rotation value has changed. If it’s positive, lean to the right, and vice verse for negative. Problem is, is that this only works in absolutes. It would only detect that you are turning left or not, and not how hard you are turning left.
And since this character is AI driven, I can’t simply grab information from inputs.
Is there another way of doing it? Or should I stick to what I have now?
I remember a commentary node in Left 4 Dead that talked about this, I don’t remember if they gave any details into how they did this.
I will try to get around to doing the commentary again and see what it says.
Could you compare the difference between the rotations and use that as a multiplier that you then feed into the anim system ?
An alternative is to accumulate the players rotation delta for N seconds in the Controller and use that.
I can try expanding on my system that I have already. I would have to have it check every tick, but running code on tick where different fps would result in different results is very sloppy. I’ll try what you suggested, though!
I know this is old but it may help me right now. What does the Get right vector and Last Frame Forward vector plug into before setting the direction variable in the second example?