Turn-In-Place Once Camera Moves Too Far Right/Left

Hey all,

As the title states, I’m currently working on a movement system on a Third-Person Character. I have a camera that moves around, but I want to create a system that turn the character in place once the camera looks too far right/left (about 60 degrees either way).

I made the code to determine the angle of difference between the Camera/Controller and the Character, but I can’t crack how to create a smooth turn-in-place.

Calculation Code:

What I’ve been trying most recently is to Set the actor rotation and interpolate the rotation, but this has made the movement choppy

I appreciate any advice on this.

Thank you,

Hey @Otter!

So you can remove the interpolate- Just use set rotation.
Because interps on such a fast repeating timer- you’re changing the speed of rotation every tick but also the values are changing every tick, so you’re doing a distance x time x time. Take one of the time variables out (the interp) and the time and rotation speed won’t be fighting 60 times a second. :slight_smile: Also with that you’d never actually stop rotating because of how the math works :frowning:

That works much better. Thank you!

However, with this turning code, the character becomes stuck in an endless loop of turning if I turn him around too much.

The turning code:

The issue:

So it look like it keeps missing the tolerance range I put in and going back and forth.

I’m also not sure why the Delta and Add Input are so different. From my understanding, all this should be in degrees.

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