I'm trying to make a game, and I was wondering if there was a way to get a player to sit into a seat without them going into a hitbox using a script? It's for a story game while the player's not allowed to move. I'm trying to make them sit in a seat using a script.
COMMUNITY QUESTION
How do you force sit a player into a seat using a script?
2 answers
I recommend that you just set the player's position to wherever you want them and then freezing their torso for the duration of your cutscene. You can have this done by a script that activates on a .Touched function ran by an invisible part when the player reaches a certain part of your story. For example, take a look at what I have below.
function onTouch(x)
if x.Parent.Humanoid then
x.Parent:MoveTo(Vector3 Position)
local Animation = x.Parent.Humanoid.Animator:LoadAnimation(x.Parent.Animate.sit.SitAnim)
Animation:Play()
wait(0.4) --Give it time to play.
x.Parent.Torso.Anchored = true
end
end
That's something small I threw together and probably won't be exactly what you want, but it's around the ballpark. If this helped you out, consider accepting this answer. If not, comment below and I'll be sure to help you out.
Unlike the answers above, you can simply do this
Seat:Sit(humanoid)
This discussion is preserved as it was. New answers, comments, and votes are closed.
