📌Point Click
Last updated
Last updated
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!
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
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.
Scriptable Object used to record all the Events from the Event trigger - Pointer Click in every clickable surface and this component.
Prefab used to display where the point click was made
What button of the mouse is used. (Left, Right, or Middle Mouse)
Radius to find a possible target nearby when clicking on an empty surface. Possible targets can be a Zone, Interactable, or another animal.
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.
Invoked when a click on a walkable surface is registered.
Invoked when a click on a possible target is registered. (Zone, Interactable, other characters)