How to Sit When Pressing a Key
Download – Sit Script
How To – Sit When Pressing a Key in Roblox Studio
What’s up everyone welcome to buzzygames, my name is BuzzyGamesBeth and today I’ll be teaching you how to sit when pressing key!
- Normally if we walk up to a chair, it automatically puts this in a sitting animation. What we want to do is we want to hold E in order to sit inside of our seat.
- First thing we’re going to make sure is that it’s disabled. In our seat we’re going to add a proximity prompt. Inside of the proximity prompt, go ahead and change the action text. I’m going to do that and change it to “hold to sit”. The whole duration will 0:50. The object text is essentially when you’re closer to the object, it’ll tell you what it is that you’re interacting with. For me, I’ll just do chair now.
- Inside of our proximity prompt, go ahead and add a script. We have a first function which checks to see if the seat is occupied or not. Then we have another function where if the seat is not occupied, then the player will be able to trigger proximity prompts.