#Character not rotating

1 messages · Page 1 of 1 (latest)

coarse epoch
coarse epoch
#

Nobody? beluga

frosty kindle
#

is the idea of this code moving from a top down perspective like in 2d, but in a 3d world?

coarse epoch
#

You see the problem @frosty kindle ?

frosty kindle
#

is your RB dynamic or kinematic?

coarse epoch
frosty kindle
#

rotating with the RB rather than the GO's transform makes you susceptible to physics-like issues. For instance if it is dynamic and you have angular drag, small increments may be ignored. Physics engine will also ignore rotation if a move is smaller than the physics sleep angular velocity

#

is there any reason in particular you don't want to do the rotation with just transform.rotation?

coarse epoch
frosty kindle
#

Quaternion newRotation=Quaternion.Lerp(transform.rotation,targetRotation,15F*Time.deltaTime);
transform.rotation = newRotation;

#

instead of your last 2 lines

coarse epoch
frosty kindle
#

consider what this part is doing: ```
Vector3 targetDirection=new(h,0,v);
Quaternion targetRotation=Quaternion.LookRotation(targetDirection,Vector3.up);

#

it is independent of where your character is facing

coarse epoch
#

blobsweats I'm not sure, takes the input and creates a rotation forward from the character?

hollow star
#

Vector3 targetDirection=new(h,0,v); , here you have to set yaw (y) to rotate

coarse epoch
#

You mean instead of that 0 or what?

hollow star