A downloadable tool

THIS SCRIPT IS EXCLUSIVE TO UNITY ENGINE

Version likely will not matter unless you are running legacy, or this tool hasn't been updated in a very, very long time.

This script will allow you to easily call a SendMessage function (which allows you to call a function attached to a different game object) when a certain event happens involving your trigger collider.

Your options:

  • Choose what object/set of objects need to enter the collider for it to trigger
  • Choose the Target (which game object has the code that you want to run). This could either be:
    • The object that entered the collider
    • The collider itself
    • A specific game object
  • Decide if the user needs to be pressing a certain button for it to trigger
  • Decide how many times it can be triggered after the first instance (0 - infinity)


The following documentation is included in the asset as a README file (please note that it might be slightly innacurate as I haven't had the time to go over it recently, and the code often changes):


- Type: how should we determine if the object entering the collider should trigger it

* Game Object -> is it the exact object set to the variable 'Trigger Object', 

* Tag -> does it have the tag listed in the variable 'Tag'

* any -> if any object enters the collider it should trigger.)

- Target: What object should we BroadcastMessage to?

* Other -> the object that triggered the collider

* SpecificGameObject -> the object set to as 'Target Game Object'

- Target Game Object: see Target

- Trigger Object: see Type

- TriggerTag: see Type

- Function: The function to call when trigger is activated (what to put in the BroadcastMessage() thing)

- RequireButton: Do you need to press a button for the trigger to work? (This does not null out any previous criterion, it is simply adding another one to the list if set true)

- ActivationInput: What button do u have to press? (should be written as an input axis {CASE SENSITIVE})

- Repeat Forever: can the trigger continue to be activated indefinetly?

- Repeat Count: how many times can the trigger be activated (N/A if Repeat Forever is set to true)


Download

Download
TriggerScript.unitypackage 2.3 kB

Leave a comment

Log in with itch.io to leave a comment.