sábado, 1 de octubre de 2022

Unity script en C# rota un gameobject al presionar rueda central del raton o mouse;

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

public class aspagiraapretarraton : MonoBehaviour
{


    // Use this for initialization
    void Start()
    {


        //transform.rotation = Quaternion.Euler (0,45, 0);
    }



    // Update is called once per frame
    void Update()

    {
        //void OnTriggerEnter(Collider other)
        {

            if (Input.GetButton("Fire3"))////// AMETRALLADORA AMETRAYADORA



            {
                // Es la rotacion de Angulos de Euler en grados.
                transform.Rotate(new Vector3(0 * Time.deltaTime, 0, 200), Space.Self);


            }
        }

    }
}