As featured in Andy’s recent tutorial; this simple package allows you to sit down and lie down on seating or beds. It allows your character to sit down in the closest free spot on any chair that supports multiple sit points. I’ve provided a few examples of how to set up the scripts as templates along side the scripts.
Search the Community tab for ‘Sitting and Lie Down’ and install the package.
All you need to do is put the SittingScript on a suitable mesh i.e. Chair (School) and this will already work for your player.
You can also setup a Trigger and then set the Trigger property to Interactable. You can then setup a locator and place this anywhere within the world and place the SittingScript on it. To make this work you will need to use the On Interact event for your trigger and add the Locator as the Entity and then set the Event as SetSeated()
If you want an NPC to sit on one of the sitting points then you need to attach the NpcSittingScript to an NPC that is placed in your world. The only other thing you need to do is set the Seat property to the object you want the NPC to sit on. The script should work out the rest!
- Seat - This is the object you want to sit on or occupy, all you need to do is to make sure this is set and has the SittingScript on the object.
- seatType - The animation/pose to adopt when on this seat. You can pick from Bed, Chair, Floor, Stool. (Optional)
- exitPoint - An additional Locator that you can set, the character will be moved to this when they are unseated, useful if you want to not end up standing forward of the object you’re occupying. (Optional)
- prompt - If you’re using the Crayta Prompts package then you can set some text here to display something suitable on the prompt. (Optional)