if (Input.GetAxis("Mouse X"))
{
var translationX = Input.GetAxis("Mouse X")* Time.deltaTime*moveSpeed;
if ( (transform.localPosition.x+translationX)<3.5 (transform.localPosition.x+translationX)>-3.5)
{
var heighttransform =translationX/2;
transform.localPosition += Vector3(translationX,heighttransform,0);
Debug.Log(transform.localPosition.x);
}
I try to move my 3rd-person-cam by mouse from left to th right and back. This works fine.
but I want this bloody thing also to go up and down.
You move the camera to the left and it shall move downwards too. When you move the camera back to the right, it shall go up, till it is above the player and when you move it more to the right it shall go down again.I ve tried so much but i cant figure out how it will work.
Does some one can give me a hint?