madvlad/ConcPerfect17

Fix moving forward not working while underwater.

Closed this issue · 1 comments

For some reason, moving forward doesn't work well.

I believe it relates to this code:
moveDirection.x = inputX * speed * inputModifyFactor;
moveDirection.z = inputY * speed * inputModifyFactor * Math.Abs(playerCam.transform.forward.z);

If the character is moving in the z direction you will experience the slowness, but if you move in the x direction you will move at the regular rate. You need to determine which direction is forward and slow down in that direction - or playerCam.transform.forward.z may not be what you are looking for here.
If you look in the x direction this value goes to 0. If you look in the z direction it goes to 1.