none
change movement mouse to movement cursor. RRS feed

  • Question

  • so this is my code .

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;

    public class ok : MonoBehaviour
    {

        float rotSpeed = 10;
        void OnMouseOver()
        {
            float rotX = Input.GetAxis("Mouse X") * rotSpeed * Mathf.Deg2Rad;
            float rotY = Input.GetAxis("Mouse Y") * rotSpeed * Mathf.Deg2Rad;
            transform.RotateAround(Vector3.up, -rotX);
            transform.RotateAround(Vector3.up, -rotY);
        }
    }

    what it does is that on the movement of mouse it rotates the object . i would like to change it from movement of mouse to movement to cursor .

    • Moved by CoolDadTx Friday, April 20, 2018 2:07 PM Third party product
    Friday, April 20, 2018 6:33 AM

All replies

  • This forum is for C#-specific questions only. Please post questions related to Unity in their forums.

    Michael Taylor http://www.michaeltaylorp3.net

    Friday, April 20, 2018 2:07 PM