Sitting and Lie Down Package

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.

Crayta Tutorial: Sitting and Lying Down - YouTube

Installation

Search the Community tab for ‘Sitting and Lie Down’ and install the package.

Usage

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!

Script Properties

NPCSittingScript:

  • 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.

SittingScript:

  • 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)
3 Likes

Love this package, been playing around with it all night and it’s done wonders to my game.

One thing I’ve noticed though, this is great for stationary seats but when it comes to moving seats like on a train or rollercoaster it becomes jerky. Is there anyway to make it smoother?

Hi Mark,

I would need to check but I don’t think anything that the script is doing would cause this, it’s possibly something to do with the underlying API. I will investigate and see what can be done either way. :slight_smile:

Could you provide a short video of what you’re seeing?

1 Like

Thanks Stuart,

Video 1: https://stadia.google.com/capture/bd7bfa1a-e506-4f30-a378-a339180dc309 using the Sitting and Lie Down Package. The train is using the Trackworx package. The camera clips through the player, it allows me to still shoot my gun, the train looks jerky.

Video 2: https://stadia.google.com/capture/e4957f0b-1fd7-4958-a59c-5513e15bd168 , using Adams Controllable Camera package, alot smoother. The little pops you see is when I shoot my gun.

Hi Mark,

I think the issue is more to do with how the game is handling the movement between the character and the objects they are sitting on/moving with. I have raised it with the team to see if there is anything we can do to improve this. I think the intention was to use the occupy script for static meshes, but we will see what we can do.

1 Like

Thank you.