Make world UI always always look at camera unity tutorial | Rotate gameObject towards camera unity

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



Category:
Tutorial
Duration: 2:36
150 views
9


ASSALAM o alaikum In this video we have shown how to rotate world ui or any object always look at camera

Code :

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

public class LookAtCamera : MonoBehaviour
{
public Camera camera;
public Transform objectToRotate;


// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
objectToRotate.rotation = Quaternion.Slerp(objectToRotate.rotation,camera.transform.rotation,3f*Time.deltaTime);
}
}

/*
/////////////////////////////////////////////////////////////////////////////////////////////
ASSALAM o alaikum
All codes and concepts and videos from this channel are non copyrighted and free to use because we believe that knowledge should be freely available for everyone
/////////////////////////////////////////////////////////////////////////////////////////////
*/




Other Videos By Muhammad Shahzaib


2022-09-29Sensor based door open/close unity tutorial | Slide door using sensor in unity3d
2022-09-27Show private variable in inspector and hide public in inspector unity3d
2022-09-25Play Pause Audio in unity3d
2022-09-22Solved Lens flare not visible in camera or game issue in unity| Flare layer in unity
2022-09-21Highlight selected button in unity easy tutorial
2022-09-18Change default cursor detailed video tutorial in unity|#unity
2022-09-15Solved You uploaded a debuggable APK or Android App Bundle unity
2022-09-14Camera follow jerk issue solution in unity3d
2022-09-13Find and change shortcut keys in unity tutorial | Shotcut keys in unity
2022-09-12Detect Button is held or being pressed in unity easy tutorial
2022-09-11Make world UI always always look at camera unity tutorial | Rotate gameObject towards camera unity
2022-09-04Effect all ui elements in group using Canvas Group unity| Canvas Group in unity
2022-09-04Attach trailer with truck using joints in unity3d
2022-08-31Balance rigidbody in unity3d | Balance rigidbody character from fall on hitting unity
2022-08-31When your game character is too much down to earth
2022-08-29Develop sun in unity3d | Add custom sun in unity3d | Lens flare in unity3d
2022-08-28Enable hinge joint and car door physics on collision unity3d | Simple car hit effect in unity3d
2022-08-27GTA like car doors effect in unity3d | Unity door physics | Hinge joint in unity
2022-08-24Wind Zone in unity | Bend trees using wind zone in unity | How to add trees on terrain
2022-08-23Simple waypoint follow AI in unity | Patrolling AI in unity3d | Waypoint system unity
2022-08-21Add 3D Text in unity3D



Tags:
unity
unity3d
learn unity
unity tutorials
unity programming
world ui look at camera unity
rotate gameobject towards camera in unity