GetInteractPrompt Script Package

Example 1: Adventure Starter Game

  1. Place trigger over shop1
  • Set size to 800 x 800 x 200
  • move trigger up to be flush with ground level
  • Add On Interact to:
    • Entity = shop1
    • Script = shopScript
    • Event = OnInteract
  • Add script
    • triggerPlayerInteractable from package Trigger Player Interactable
    • No additional settings - see package README
  1. Testing and Notes
  • place a line to see the trigger in preview
  • in preview mode
    • the prompt will show up for the player any where in the trigger area
    • accessibility: the user may not always be able to face the player in the exact direction
  1. Screenshot

Example 2: Door

  1. Place a door in the world
  • add doorScript from Door package (official Crayta)
  • leave the Start State as “closed”
  1. add trigger to door
  • Set size to 800 x 800 x 300
  • move trigger up to be flush with ground level
  1. next part
  • adding scripts to interact with the door to open and close
  • adding an interact prompt to the user for each one
  1. Add scripts
  • add triggerPlayerInteractable (as above)
  • add GetInteractPrompt Script from package GetInteractPrompt
  • On Interact
    • Interact Prompt = Open
    • Script = doorScript
    • Event = Toggle
  1. getInteractPrompt Settings:
  • Interact Prompt = Interact
  • leave all other settings empty
  1. Testing and Notes:
  • place a line to see the trigger in preview
  • in preview mode
    • the prompt will show up for the player any where in the trigger area
    • accessibility: the user may not always be able to face the player in the exact direction
  1. Explanation
  • the door script has several functions to pick from on Interact Entity
  • there is only one prompt for this script hence the word Interact was used
  1. Screenshots


Example 3: Using the last 4 fields of GetInteractPrompt
(advanced use)

This is used as conditional to display interact prompt.
Basically specify the

  • entity to query
  • true or false
  • script property (needs to boolean)
    or
  • property on entity like visible (also needs to be boolean)

If one of the last two fields are not empty, the script will attempt to check and return true or false. The default is true allowing no data to be true basic script use.

an example of this advanced use can be found in the event trigger package game (it’s remixable).

  • one example using visible
  • one example using doors which uses door animation script for a boolean state to check against

note:

  • nteract will still work, just not display the text to the prompt
  • just something to be aware of
1 Like