Skip to content

Adding interactions

Caitlin Donahue edited this page Feb 19, 2017 · 15 revisions

Adding the FirstPersonInteractor

To be able to use Prairie's interactions a FirstPersonInteractor component must be added to the player object. The easiest way to do this is to use Praire's Prairie Player prefab. This can be found in the Prairie folder in assets, under framework->prefabs. If you would like to use your own player, you can add the component FirstPersonInteractor to it, either by searching for it in the add component menu, or finding it in the add component menu under Prairie->Utility (Need to double check that that is the right place, add gif of this?).

Adding Interactions to Game Objects

Adding a Collider

For the player to be able to 'see' interactions, the object holding the interaction must have a collider attached to it. These can be added through the add component menu.

Adding the Interaction

There are 3 ways to add an interaction. The easiest would be to open the add component menu, and navigate to Prairie->Interactions, where there all of the interactions are stored (with the exception of annotations and slideshows, which are stored under Prairie->Annotations). Select the interaction you would like, and it will be added to the game object.

Gif on this here

Interactions can also be added by searching the name of the interaction in the add component menu, or by navigating to Prairie->framework->scripts->interactions in Unity's file explorer and dragging the script for your desired interaction onto the object.

Prompts

Upon adding an interaction to an object (with the exception of annotations), a prompt component will also be added to that object. The prompt is the text that the player will see when mousing over an object they can interact with. Most interactions are auto-populated with a default value, but this value can be changed. If the prompt field is left empty, there will be no text displayed when a user looks at the object.

Gif of prompts in action

Cyclic Prompts

There is an option to make a prompt 'cyclic' by checking the cyclic prompt box. This will show an extra text field, which allows for two prompts to be used on an object, where these prompts alternate every time the object is interacted with. This is especially useful in situations where the event would logically 'toggle' such as turning lights on and off, or opening and closing doors.

gif of adding cyclic prompts, and how they work

###Twine Node Prompts TODO