- Home /
advanced problem for me regarding transfering rotation from the gizmo to the object
let me first explain what i am trying to do.
i made a gui that looks like a joystick, so when moving it around i want to rotate the camera in the scene. it is simple line from the center to the middle of the circle. the values of x and y range from -50 to 50. i thought it would be simple to transfer these amounts to the rotation of the camera in the scene. for example when value is higher (the highest 50, or --50 - oppostite rotation) rotation is faster, when values for x or y are lower, the rotation is slower. x would be rotation along x and y along y axis.
i am currently using mouse orbit script where rotation is represented by x and y values. i am sure most of you know that script, here are the lines that calculate rotation:
x += Input.GetAxis("Mouse X") * xSpeed * 0.04;
y -= Input.GetAxis("Mouse Y") * ySpeed * 0.04;
so question is how to make values from the joystick (x and y) correspond correctly to the rotation of the camera? the problem is because Input.GetAxis("Mouse X") gives values 0 to 1
any suggestions are welcome! i attached the sketch, it might make things clearer.
Your answer
Follow this Question
Related Questions
move the object where camera look 0 Answers
Rotation of player based on camera direction and joystick direction in 3D world 1 Answer
How to deal with joystick moving and screen swiping colliding? 0 Answers
How do I properly rotate an FPS camera with a joystick? 1 Answer
Joystick problem (i only want horizontal movement) 0 Answers