Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to have character automatically "eat" object when it gets close enough?

Discussion in 'Scripting' started by Wolfieman, Nov 22, 2017.

  1. Wolfieman

    Wolfieman

    Joined:
    Jun 5, 2017
    Posts:
    7
    I know how to do it manually, but how can I have the player character display an animation and "eat" an object it gets close to? For example, if the player is a fish and gets close enough to another fish, display "eat" animation, the eaten fish vanishes and the player gets a point. Manually is no problem, it's automatic so you don't have to unnecessarily press a button I'm struggling with...
     
    Last edited: Nov 22, 2017
  2. Kaart

    Kaart

    Joined:
    Jul 31, 2017
    Posts:
    62