Need Help with 3rd Person Camera


i have just started learning GODOT 4 and i basically putting a 3d model from Maximo with animation and moving it around a ground place.

camera is independent from player. when camera is rotated, player forward is re adjusted to match that of camera. however, once new forward is assigned to player, player rotates 90 deg and scale is reset to 1. i then have to offset that 90 deg and re-assign back model to original scale.

the movement when i move model in different direction is not smooth and jittery even thu i used lerp_angle but the weight can only be set as 1 otherwise the rotation would not be correct for model.

please advice on what im doing wrong. i need a smooth rotation of character from idle to new direction. below is video and code, plz advice.

This playlist will help you for creating tps controller

Please can you look at my code below and tell me what im doing wrong, thanks

this is cam controller script

I think all is ok, do you found any problem?

Yes, below part
armature.rotation.y=lerp_angle(armature.rotation.y,atan2( direction.x,direction.z)-camcontrol.rotation.y, 1)

whenever i change direction…the rotation is snappy and not smooth between Idle and walk/run incase player direction is changed but if i walk/run from idle in same direction player is facing (ie no change in direction ) motion is smooth. plz advice

You need to multiply the speed with delta:

armature.rotation.y = lerp_angle(armature.rotation.y, atan2( direction.x,direction.z)-camcontrol.rotation.y,  7*delta)