Search Results
7/15/2025, 2:09:50 AM
i have this code thats meant to rotate the camera and orient it with gravity, while maintaining the direction the player is looking in and it works but when the gravity isnt doing a large jump i want it to follow the gravitys direction.
picrel is a drawing of what is currently happening vs what i want to happen, any clue how i could make it work?
im clueless and stuck (again)
head.rotation = Quaternion.LookRotation(head.forward, -gravDir);
head.Rotate(Vector3.up, mouseX * sens * Time.fixedTime);
yrot = Mathf.Clamp(yrot + (mouseY * sens * Time.fixedTime), -89f, 89f);
cam.localRotation = Quaternion.Euler(yrot,0,0);
picrel is a drawing of what is currently happening vs what i want to happen, any clue how i could make it work?
im clueless and stuck (again)
head.rotation = Quaternion.LookRotation(head.forward, -gravDir);
head.Rotate(Vector3.up, mouseX * sens * Time.fixedTime);
yrot = Mathf.Clamp(yrot + (mouseY * sens * Time.fixedTime), -89f, 89f);
cam.localRotation = Quaternion.Euler(yrot,0,0);
Page 1