Answer the question
In order to leave comments, you need to log in
What causes an object to fly away on the z-axis by -10?
Mortire.transform.position = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y , 0));
float mouseY = Input.GetAxis("Mouse Y");
float mouseX = Input.GetAxis("Mouse X");
Answer the question
In order to leave comments, you need to log in
Vector3 mousePosition = new Vector3(Input.mousePosition.x, Input.mousePosition.y, 10f);
Vector3 objPosition = Camera.main.ScreenToWorldPoint(mousePosition);
Mortire.gameObject.transform.position = objPosition;
Just try
Mortire.transform.position = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y , 0));
Mortire.transform.position.z=0;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question