Categories
Game Creation Mastering Development

Unity – move with WASD in the way the camera is facing

I have this C# code for rotating the camera with the mouse: public float mouseSensitivity = 100.0f; public float clampAngle = 80.0f; private float rotY = 0.0f; // rotation around the up/y axis private float rotX = 0.0f; // rotation around the right/x axis void Start() { Screen.lockCursor = true; Vector3 rot = transform.localRotation.eulerAngles; rotY […]

Categories
Development

Why is the value incremented when assigned?

I’m making a GUI for the game (Open Gl). That is, I have a Gui Screen on which other components are added. So I wanted to make all other GUIs move to the left relative to the original position of GuiScreen. It works but not as I wanted simply contrary to logic. Here i have […]