Quantcast
Channel: Questions in topic: "clone"
Viewing all articles
Browse latest Browse all 508

Script finding a none-existing player clone

$
0
0
Hi! I am making a simple player follow script and it is not working. When I checked what it is finding, it is finding "Player(Clone)". There is no clone in the scene or in the prefabs. Why is it doing this? My code. using UnityEngine; using System.Collections; public class CameraFollow : MonoBehaviour { public GameObject target; void Start(){ target = GameObject.FindGameObjectWithTag("Player"); } void Update(){ transform.position = new Vector3(target.transform.position.x, target.transform.position.y, -10); } }

Viewing all articles
Browse latest Browse all 508