How to detect a player trying to sit BEFORE the weld is made?

tl;dr at the bottom for those who dont want to read allat

I’m currently trying to create a system for artificial gravity (think like wallwalking games where the character can stand on walls and roofs) however since the humanoid naturally tries to make the character stand upright i’ve deactivated the humanoid by setting its HumanoidState to Physics and im currently remaking everything it does, such as using physics constraints to recreate a movement system.

currently im using LinearVelocity for walking, as it applies any force to stay at a constant velocity (unlike VectorForces). apparently though, this is a problem as when the character sits down, becomes welded with the seat and teleports into the correct position, the LinearVelocity seemingly applies a force against that and brings the seat TO the character instead. obviously this is bad as when sitting into any unanchored seat such as a chair or a vehicle, the whole assembly will jerk towards the character instead of the other way around.

how would i therefore detect when the player tries to sit ONLY before the SeatWeld is made and before the seat is forced towards the player? the simplest event i could think of, doing Humanoid.Seated when the character is added seemingly only sometimes works correctly, and so i cant tell how i would guarantee detecting before the player sits without creating a custom system for sitting like with ProximityPrompts which i would prefer not to do over walking into a seat which may be more simpler for players.

also aside from the original post but is this method of completely deactivating the humanoid to stop it standing upright actually nessecary? can i disable the humanoid from trying to stand upright while keeping as much functionality as possible? (walking, jumping, swimming, climbing) i obviously kinda doubt it but at the same time it would be alot easier to only remake some parts of the humanoid rather than the whole thing lol

tl;dr what event/method guarantees detecting when a character sits into a Seat/VehicleSeat before the SeatWeld is made? (not Humanoid.Seated apparently)

1 Like

You could try disabling the HumanoidStateType for Seated through invoking SetStateEnabled on the player’s Humanoid. Not sure if this would work?

HumanoidStateType | Documentation - Roblox Creator Hub

Only solution I can think of is creating your own seat object from scratch, which might allow you to get rid of the strange behavior related to the LinearVelocity.

Personally I’ve had an issue with Seats in the past, so your post doesn’t surprise me: Seat:Sit() does not consistently work from client - #8 by BanTech

As for how I’ve created a custom seat before, I used the Touched event for entering the seat and the UserInputService.JumpRequest event for exiting, and kept track of who was in the seat internally.

I already know about this method (i am actually already using it when the client detects the humanoid has sat to cause the sitting animation) but i think you misunderstood my question/s. my question was how to detect when the humanoid was about to sit on its own, not how to force the humanoid to go into the sitting state

yeah, i kinda guessed that would be the only way around this :confused: i’ll add another thing i gotta remake to the list then i guess lol

as for the advice on how to actually create the custom seat;

thanks for letting me know about both methods for getting into/out of the seat, i didnt actually know JumpRequest was a thing lmao, i’ll check it out :+1:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.