Skip to content
Snippets Groups Projects
Commit 0e8cae62 authored by Alifia Rahmah's avatar Alifia Rahmah
Browse files

fix(pet): find tag player from setup in PetMovement

parent 5e1abdaf
No related merge requests found
...@@ -8,10 +8,13 @@ public class PetMovement: MonoBehaviour ...@@ -8,10 +8,13 @@ public class PetMovement: MonoBehaviour
public Transform target; public Transform target;
protected NavMeshAgent nav; protected NavMeshAgent nav;
Animator anim; Animator anim;
public float rotationSpeed = 10f; public float rotationSpeed = 10f;
void Awake() void Awake()
{ {
GameObject player = GameObject.FindGameObjectWithTag("Player");
target = player.transform;
nav = GetComponent<NavMeshAgent>(); nav = GetComponent<NavMeshAgent>();
anim = GetComponent<Animator>(); anim = GetComponent<Animator>();
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment