- Home /
Question by
InsertNamehere · Jun 30, 2017 at 02:59 PM ·
cameramovementlimitmathf.clampx-axis
Using Mathf.Clamp To Limit Camera Movement
Hello guys i'm trying to work something out using Mathf.Clamp. I have a camera in my scene. Everytime i press a key (in the code its "D") i wan't my camera to move +75 on X axis. The code is working but not working as i wanted. I limited it's maxX to 225 but if i hit my key again at 225 it goes to 300. And stops at 300. It's my first time using Mathf.Clamp probably a mistake in the code that i cannot see :D Thanks!
tl;dr
Mathf.Clamp should stop at 225 but stops at 300. How to stop at 225.
ekran-alıntısı.png
(22.3 kB)
Comment