// This function is called once per frame to update the object based on state behaviour public override void UpdateState() { // Look at the player Vector3 position = new Vector3(player.transform.position.x, transform.position.y, player.transform.position.z); transform.parent.LookAt(position); GetComponentInParent <Particle3D>().rotation = transform.rotation; // Is the object grounded? if (goombaScript.GetGroundedState()) { // Move forward, towards the player goombaScript.SprintInADirection(transform.forward, chaseSpeed); } }