#jerky camera making me annoyed
1 messages · Page 1 of 1 (latest)
- not parented to the player in any way
- configuration of both components in the camera
- camera controller's code
- "lock camera to head" code
Never multiply mouse input with Time.deltaTime. This actually makes it different speed at different length frames, causing the jerkiness you see
Here's more info on that https://unity.huh.how/mouse-input-and-deltatime
After you remove that make sure to make your sensitivity multipliers about 50-100x smaller
thank you osmal ❤️
i feel like an idiot now lol
been struggling with this for about an hour
now i just need to get rid of the lag that seems to be present for no reason
This mouse-deltatime thing is one of the most common mistakes because of some big youtubers (like Brackeys) pushed it and also ChatGPT suggests it without a fail
i think i actually got it from just thinking "oh yeah, i should just multiply everything by deltatime 😃! for no reason! good job me :D"
and when i was struggling with it i ended up caving and asking chatgpt which didnt friggin help obviously :/
Yeah it's something I actually did too many years ago (before brackeys and LLMs) because it sounded like the right thing to do lol
Is it actual framerate lag or just the camera feeling laggy?
also, configure your ide
Hard to tell from a video
!vscode
If your IDE is not underlining errors in red or autocompleting code,
please configure it using the link below:
can't tell yet
i dont have autocomplete code enabled
mainly because i like to actually use my brain and suffer from my mistakes
this isn't about the AI suggestions
oh yeah
it's autocomplete per-word
errors are underlined in red, yes
probably just syntax errors
it's clearly not configured properly
you don't have proper syntax highlighting
try doing transform.position = 0;, see if that errors
It clearly doesn't know anything about the unity types (UnityEngine, MonoBehaviour, Vector3 should be different color)
that looks like it's outside the class
that would be a syntax error
put it in Start
you should have this kind of autocomplete box - this is called intellisense, it doesn't write code for you, it just helps you write code faster
(if the icon on the left is just abc, that's not configured properly.)
yeah
i assume cameraPosition is taken from the player? this should be done in LateUpdate so it's up-to-date with the player's position in the current frame
(or you could have the camera be a child of the player, tbh)
for some weird reason when the camera is the child of the player i cannot look up or down
if orientation is also the player transform, you'd need to set its rotation first, and then set the current rotation (or use local rotations)