lerpz movement question

Hello,

I have a quick question regarding lerpz movement.

I tried searching on the forum if i could find anything regarding this matter but no luck, or unless i missed it.

Anyways I am Studying with the 3rdperson demo tutorial , trying to learn as much as i can, and I noticed that lerpz snaps in a 90 degree angle while on idle if i try to rotate him horizontally with keyboard buttons “a” or “d” and, also if I try to make him move backwards with “s” key, he snaps 180 degree angle.

I am trying to make him rotate smoothly while pressing “a” or “d” keys, and make him walk backwards while pressing “s”, (I know there is no backwards walking animation for lerps on the demo, but at least i want him move backwards in its regular forward walk or run animation instead of snapping 180 degree)

is there a way of doing this without him snapping in a 90 degree angle or 180 for backwards walking?

I have tried lots of settings and no success, one of it was the 3rd person controller script changing the rotation speed, and it seems to work but only while on walking or running mode, but not while lerpz is on idle mode.
also tried the edit → project settings → input to change the axis settings and no luck eather.
Any suggestions?

thank you in advanced.

Look at the script handling movment, called thirdpersoncontroller, around line 60 ( if i recall correctly, or handle rotation: if speed is higher than 0.1*walkspeed than lerp from current rotation; if it’s lower ( so le you are not walking) just snap to it.

Philip

Hi PhilipV,

thank you, it workled, it was on line 146

// If we are really slow, just snap to the target direction
if (moveSpeed < walkSpeed * 0.0 grounded)

i set it to 0.0 from 0.7 and it worked , now it turns smoothly on “a” or “d” keys

although i could not get the moving backwards to work

when i press “s” key on my keyboard it just keeps on going forward instead of moving backwards relative to to camera.

I tried messing with line 53 and no luck:

// Are we moving backwards (This locks the camera to not do a 180 degree spin)
private var movingBack = false;
// Is the user pressing any keys?
private var isMoving = false;

also with line 130 and on and no luck eather:

// Are we moving backwards or looking backwards
if (v < -0.2)
movingBack = false;
else
movingBack = true;

var wasMoving = isMoving;
isMoving = Mathf.Abs (h) > 0.1 || Mathf.Abs (v) > 0.1;

// Target direction relative to the camera
var targetDirection = h * right + v * forward;

it just keep on moving forward weather i press the “w” or “s” key.

any suggestions.

thank you in advanced