Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

The rapid spinning wasn't consistent, which is strange, sometimes it was slower moving then it would move really fast. It could be in the Look function. In your Look function, you are rotating the X on transform.rotation, but rating the Y on camera.transform.localRotation.

Shouldn't you be rotating the camera on both X and Y in the same way? I'm assuming this code is on your player, so you are rotating the player on X but the camera on Y?

(+1)

"so you are rotating the player on X but the camera on Y?" Well, yeah. So I rotate the y on the player with x input from the mouse, which rotates the player, with camera and anything else under the player. Then when its time to rotate up and down, you only want the camera to rotate. Not the player, just the camera. Thats why the y input rotates the camera. If you have any suggestions on a better way that would be great(I am pretty sure you could get a better working camera with Cinemachine)

Yeah Cinemachine works pretty great, but I'm afraid I rarely develop in 3D so I don't have another solution. Either way it doesn't seem like it's that that's causing it