- Home /
How do I make my camera follow selected player?
Hi
I have made a Character Selection scene and coded everything, but when a character is selected how do I make the camera follow that specific character? Right now I have made a "Follow Player" script, but it only follows the character assigned to it, i want to make it follow the character which is selected by the player of the game. Hope everyone can understand my question. Looking forward to a answer for this question. Thanks
My "Follow Player" script:
using UnityEngine;
public class FollowPlayer : MonoBehaviour {
public Transform player;
public Vector3 Follow;
// Update is called once per frame
void Update () {
transform.position = player.position + Follow;
}
}
Your answer
Follow this Question
Related Questions
Healthbar follow with screenspace-camera canvas 0 Answers
How to change the focus of the camera? 0 Answers
Using a Pre Rendered character as the player 0 Answers
Problems with Camera (Camera keeps looking at the feet of my character) 1 Answer
Camera rotating around player, but passes trough objects 0 Answers