How to Make Camera Follow In UNITY 2D
TechSurfer
Hello Everyone In This video I have shown you how you can make camera follow player in unity 2D
▼ Code▼ using System.Collections; using System.Collections.Generic; using UnityEngine;
public class CameraFollow : MonoBehaviour { public float FollowSpeed = 2f; public float yOffset =1f; public Transform target;
// Update is called once per frame
void Update()
{
Vector3 newPos = new Vector3(target.position.x,target.position.y + yOffset,-10f);
transform.position = Vector3.Slerp(transform.position,newPos,FollowSpeed*Time.deltaTime);
}
}
♫ MUSIC Track: Electro-Light - Where It All Began (feat. Danyka Nadeau) [NCS Release]
▼ Tags ▼ unity,main menu,menu,unity tutorial,unity main menu,how to make a main menu in unity,main menu unity,unity3d,start menu unity,creating a start menu in unity 5,unity 3d,main menu in unity,main,unity how to make a main menu,creating a main menu in unity 5,making a start menu in unity 5,making main menu unity 5,unity ui,main menu unity 5,start menu,start menu in unity,gamedevelopment
#unity #gameDevelopment #game #unityengine ... https://www.youtube.com/watch?v=FXqwunFQuao
9330875 Bytes