Target indicator in unity easy tutorial
Channel:
Subscribers:
1,110
Published on ● Video Link: https://www.youtube.com/watch?v=ILzLHDjzXyA
Code :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TargetIndicator : MonoBehaviour
{
public Transform target;
public float rotationSpeed;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
transform.rotation = Quaternion.Slerp(transform.rotation,Quaternion.LookRotation(target.position-transform.position),
rotationSpeed*Time.deltaTime);
}
}
Other Videos By Muhammad Shahzaib
Tags:
unity
unity3d
unity tutorials
learn unity
unity programming
target indicator in unity
learn gaming