Different ways to rotate a gameobject in unity3d

Subscribers:
1,110
Published on ● Video Link: https://www.youtube.com/watch?v=zd2CTMD5RAk



Duration: 2:48
84 views
5


Rotate rigid body stats at : 1:40

Code :

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

public class Rotator : MonoBehaviour
{
public Vector3 speed;
public float torqueforce;
// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
// transform.Rotate(speed*Time.deltaTime);

//////// if your gameobject is child of some other object ///////////

//transform.localEulerAngles += speed * Time.deltaTime;

/////////////// if your game object has a rigid body //////////

// GetComponent lessThanSign Rigidbody greater than Sign().AddTorque(transform.up*torqueforce*Time.deltaTime,ForceMode.Force);
}
}







Tags:
unity
unity3d
learn unity
unity tutorials
rotation in unity
rotate rigidbody in unity
different rotations in unity
add torque in unity