Visual Scripting In Unity : Rotate an object

Here are variations on how to rotate an object using visual scripting. For this demonstration I made two cubes rotate automatically as well as via user input. One will rotate using the XBox controller and the other one is controlled using keyboard.

Continue reading Visual Scripting In Unity : Rotate an object

Unity Rotate Object

A simple script to rotate object in Unity

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

public class Rotate : MonoBehaviour
{
    Vector3 movement;
    public int xi, yi, zi;

   
    void Start()
    {
        movement = new Vector3(xi, yi, zi);
    }

    
    void Update()
    {
        transform.Rotate(movement * Time.deltaTime);
    }
}


Add values to the public variables xi, yi, zi depending on the speed and direction you would like the object to rotate.