📌Point Click

The Point Click component allows for AI animals to move with point-click movement - similar to what you would find in a MOBA or a Top Down RPG - you click, the events fire.

It's not just limited to that though, you can be creative and use the events for other purposes too unrelated to movement!

Requirements

  • It needs an AI Control component and an AI agent already attached to the character.

  • A Unity Event System needs to be on the scene. This will send all the click events to the script.

  • Every clickable surface that the animal can walk, needs to have an event Trigger Event with a Pointer Click with the next setting:

  • Zones and Interactables components do not need the Event trigger - Pointer Click

How to Set it Up

In the same AI Control gameobject, add it by searching for Point Click, or by going to Add Component -> Malbers -> AI -> Point Click

This automatically connects all the events and parameters to the AI Control component.

Parameters

Point Click Data

Scriptable Object used to record all the Events from the Event trigger - Pointer Click in every clickable surface and this component.

Point UI

Prefab used to display where the point click was made

Button

What button of the mouse is used. (Left, Right, or Middle Mouse)

Radius

Radius to find a possible target nearby when clicking on an empty surface. Possible targets can be a Zone, Interactable, or another animal.

Clear Target

When the animal has a target already assigned, it will clear the current target on the AI control component if the next click is on an empty surface.

Events

On Point Click

Invoked when a click on a walkable surface is registered.

On AI Target Click

Invoked when a click on a possible target is registered. (Zone, Interactable, other characters)

Last updated