protected override void Update() { base.Update(); if (Vector3.Distance(position, targetTreasure.transform.position) < radius) { targetTreasure.OnGrab(); } }
protected override void Update() { base.Update(); // If colliding with a treasure, activate the treasure's "on grab" method if (Vector3.Distance(position, targetTreasure.transform.position) < radius) { targetTreasure.OnGrab(); } }