- Home /
moving an object with mouse ( my script is not smooth enough )
Hi friends I have wrote this script to moving an object by moving my mouse ( it's for a mouse maze game but i don't want to use mouse position as player position), The problem is my player movments are not smooth enough, i have changed mouse speed variable and size of player too but still it's not good smooth moves for player, what can i do to get better result for this mean? using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI;
 public class MouseControllerScript : MonoBehaviour {
     public GameObject player;
     public Text positionText;
     public float mouseSpeed = 1;
     // Use this for initialization
     void Start () {
         
         
     }
     
     // Update is called once per frame
     void Update () {
         player.transform.position += new Vector3 (Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y"), 0.0f) * Time.deltaTime * mouseSpeed;
         positionText.text = player.transform.position.ToString ();
 
     }
 }
 
Regards
               Comment
              
 
               
              I changed my mouse sensitivity from input setting and I think it's better now, but I think maybe you have better idea for this purpose!
Your answer
 
 
              koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                