Skip to content

Destroying an agent. #1

Description

@theModernSurrealist

Hi there,

Unity 2020.3.15f1 Personal
I have followed your boids tutorial and am using it to control fish in my game. In this game, I wish to destroy a flock agent. However, when this happens, I get this error: MissingReferenceException: The object of type 'FlockAgent' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object. I am destroying it using Destroy(col.transform.gameObject). What can I do to bypass this?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions