As the title says.
I’m using EvaluateStateMachine turned off for my game. The :Sit() method on a seat object, although works, is based on the “SeatPart” property of the humanoid. I’m making the humanoid jump out of the seat by breaking the weld (also tried disabling the seat for 1 frame), however since this is not the standard method of making humanoids jump the engine does not clean up the seatpart property.
Since the property is not cleaned up, the seat:Sit() method can only be used once before breaking for eternity as roblox thinks im still sitting. This means that you can only sit once before resetting your character.
Doing the standard method of humanoid.Jump = true will not work since the state machine is off.
Is there anyway to indirectly clean up this property, or will I have to make custom seats?
It seems like there is no way to clean up the SeatPart property while EvaluateStateMachine is off, and you will probably have to make your own custom seats.
The closest you can get without making your own seat is to set the LocalPlayer’s EvaluateStateMachine property to true then immediately set PlatformStand to true, then set both of those 2 properties back to false. This cleans up the SeatPart property in the smoothest way possible.
Oh yeah, that could work. When he said “also tried disabling the seat for 1 frame”, I didn’t read the sentence well and my brain registered it as deleting and recreating the seat in 1 frame, not the Disabled property. He could destroy the seat then recreate another one, and just make a normal part to cover up the deletion and recreation of the seat.
I did try enabling EvaluateStateMachine after that, and it doesn’t clean up; seems to work event based while the property is on, so unless the property is momentarily turned on before jumping out I don’t believe it will work.
This might work, although I haven’t tried it. It’s definitely a hassle considering seats also have proximity prompts inside themselves to be used, which will then have to be reconnected and then also all the welds need to be transferred… so yeah.
For now, I have implemented my own custom seats.
This post stays up, if anyone ever finds a definitive answer then I will mark that as solution.
The suggestion to momentarily turn on does work, although there’s a caveat, you must wait for a very short while for it to do its thing (don’t ask me why), here’s a snippet of some code I used to accomplish the reset SeatPart
hum.Changed:Connect(function(property)
if property ~= "SeatPart" then return end
local seatPart = hum.SeatPart
if not seatPart then return end
if seatPart.Name == "DriveSeat" then
hum.EvaluateStateMachine = true
task.wait(0.1)
seatPart.Disabled = true
hum.Jump = true
hum.Sit = false
printer:MoveTo(seatPart.Position + (seatPart.CFrame.LookVector * 15))
task.delay(1, function()
seatPart.Disabled = false
hum.EvaluateStateMachine = false
end)
end
end)
You can probably fiddle with the timing of turning off of the EvaluateStateMachine but for my use case 1 second was good enough