SebLague / Solar-System

Simple solar system experiment
https://www.youtube.com/watch?v=7axImc1sxa0
MIT License
1.15k stars 315 forks source link

Rotation via mouse when walking causes violent shaking #18

Open Void-n-Null opened 3 years ago

Void-n-Null commented 3 years ago

I must say i absolutely love this project! But unfortunately every time i get off the spaceship onto the surface of a planet, the character controller starts spasming violently every time i rotate the player via moving the mouse. If anyone has found an easy way to fix this issue id love to hear it or hopefully someone can at-least help me brainstorm why this problem happens.

Thanks!

slippedhal0 commented 3 years ago

I must say i absolutely love this project! But unfortunately every time i get off the spaceship onto the surface of a planet, the character controller starts spasming violently every time i rotate the player via moving the mouse. If anyone has found an easy way to fix this issue id love to hear it or hopefully someone can at-least help me brainstorm why this problem happens.

Thanks!

Try actually building the game, the editor has shaky Player Controller issues, but the build does not for me.

MachoBrizzin commented 3 years ago

@slippedhal0 Building the game doesn't seem to fix the issue (at least for me). I have noticed though, that the issue only seems to really happen when the player looks around along the X axis (looking up and down doesn't have the problem).

I imagine this is due the fact that, when the camera turns left or right, it's rotating the player object as a whole and not just the camera (whereas looking up and down only moves the camera). This means there's physics involved and something about that is being thrown off, resulting in the jerkiness seen here:

https://imgur.com/Ap0cZZh

@SebLague Could you give us a hand in fixing this issue? There has been at least one other issue posted here with a bunch of people reporting that they have the same problem. It's really messing things up for a lot of folks here.

Delofon commented 3 years ago

Commited to a PR that should hopefully fix this issue.

foggyfields commented 1 year ago

In the Player Controller script there is an Update and a Fixed Update. I moved the code being run in the Update to the Fixed Update. Stopped the jitter.