using UnityEngine;
public class Rotation_demo : MonoBehaviour
{
Vector3 rot=new Vector3(10,10,10);
void Start()
{
transform.Rotate(rot);
}
}
Transform.Rotate(Vector3 eulers)
// you can add relativeTo=Space.Self for it to rotate arround itself or do
// relativeTo=Space.World to rotate relative to the scene
// https://docs.unity3d.com/ScriptReference/Transform.Rotate.html
using UnityEngine;
public class rotation_example : MonoBehaviour
{
public float torque;
public Rigidbody rig;
void Start()
{
rig = GetComponent<Rigidbody>();
}
void FixedUpdate()
{
rig.AddTorque(transform.up * torque);
}
}