madvlad / ConcPerfect17

ConcPerfect17 is a completed 3D multiplayer platforming and physics based puzzle/racing game targeted for Windows machines.
GNU General Public License v3.0
0 stars 0 forks source link

Fix moving forward not working while underwater. #317

Closed ghost closed 6 years ago

ghost commented 7 years ago

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

xweskingx commented 7 years ago

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.