- Home /
Translating key not working with smooth mouse orbit
I just posted a question about translating in a axis using the below code.
function Update () { if (Input.GetKeyDown("space")){ print("space key was pressed"); transform.Translate(Vector3(0,0,speed) * Time.deltaTime); } } However due to client demands, there is a smooth mouse orbit that disables the above code. I require a mouse orbit and translation component; both required by the client no compromise.
I wonder if there is a way to fuse both; Translate and Smooth Mouse Orbit.
Could you explain this a bit better? The mouse never goes away, under what circumstances should the 'translation' bit actually work?
The client wants a camera to orbit a 3d model of a city. However he wanted to add a forward/backward function not zoo$$anonymous$$g however.
The smooth mouse orbit has been changed to respond to WASD keys. While the forward/backward function is set to another letters "I" and "O" to simulate zoom in and zoom out.
I am not sure if both scripts can function together. Using the arrow keys to orbit the model while using the Translation with I,O. All testing I have done has only proven that both cannot co-exist.
ONe their programmers has demonstrated how to do it but he is uncontactable at the moment so I am here for answers.
Well, I can't really think of any reason why you can't just move the pivot point with O and I, and move the camera with the mouse (or WASD, whatever). Think of it like a 3rd-person camera, but without the person.
Now I am exploring moving the pivot, ut however is there a script to make it follow the orientation of the camera?
I finally solved it... Thanks a lot syclamoth! $$anonymous$$aybe animating the pivot was the trick!
Your answer
![](https://koobas.hobune.stream/wayback/20220613063400im_/https://answers.unity.com/themes/thub/images/avi.jpg)