Action Trigger package

Name: Action Trigger
By AdamO in Discord

Created and demonstrated on a stream here - https://youtu.be/unOL6WvKl7M?t=3079

The Action Trigger is a package that allows you to detect player inputs whenever they’re inside a trigger, and call events from any key press / release while they’re in the trigger. If used with the Prompts package (standard Crayta package), it will also display a prompt to the player when they’re in the trigger. This can stack, so if there’s a trigger inside another trigger, both prompts can be displayed, and the inputs can be detected for each trigger.

To set up:

  • Add the “PlayerAction” script folder to your player template
  • Place an instance of the ActionTrigger template in your world wherever you want the player to do an action.
  • On the ActionTrigger, you can set the button that it will “listen for”, and the prompt message that will be displayed to the player. Then set up the actionPress and actionRelease event properties to do any action you want when the player presses or releases the given button

Example uses:

  • Turn lights on/off in a room, from anywhere in that room
  • Kill another player by getting into a trigger around them (that’s attached to the player template) and pressing a button
  • Allow collecting a pickup from anywhere within a larger trigger around that pickup, regardless of whether you’re looking at the pickup - just connect the actionPress event to the “Pickup” function on a pickupSpawnerScript
2 Likes