Walking issue after seat eject

Heyya, I’m trying to make a simple code that detects if the car crashed using the Touched function and then ejects the player from the seat. The problem I have is after the script ejects the player, the player’s walking seems wonky and weird.

I’m trying to make it so that after the eject, the player’s walking doesn’t slide and there is where I’m asking for help.

I’ve tried looking through some old bug reports and scripting support here in the devforum but I didn’t find or missed the solution to my problem.

Here’s a video of what I meant: https://streamable.com/05qjre

Here’s the code I am currently using:

local speed = 0
local isDamaged = false
local P = script.Parent.Parent.Parent.Parent.DriveSeat

script.Parent.Touched:Connect(function()
	if isDamaged == false then
		speed = script.Parent.Velocity.Magnitude
		print(speed)
		wait()
		if speed > 100 then
			isDamaged = true
			script.Parent.Parent.CrashSmoke.Fire.Enabled = true
			script.Parent.Parent.CrashSmoke.Smoke.Enabled = true
			script.Parent.Parent.Parent.Parent["A-Chassis Tune"].Initialize.Disabled = true
			wait(2)
			local occupant = P.Occupant
			if occupant ~= nil then
				occupant.Sit = false
			end
		elseif speed > 70 and speed < 100 then
			isDamaged = true
			script.Parent.Parent.CrashSmoke.Smoke.Enabled = true
			script.Parent.Parent.Parent.Parent["A-Chassis Tune"].Initialize.Disabled = true
			wait(2)
			local occupant = P.Occupant
			if occupant ~= nil then
				occupant.Sit = false
			end
		end
	end
end)

I haven’t really optimized the code yet since I’m still trying to finalize and fix the problems I’m encountering.

Thanks for your time and I hope there’s a simple solution to this.

2 Likes

this happens to quite alot of people I know, I don’t know why this happens but a way to fix it is by making the players sit variable false BEFORE you disable any scripts or destroy any seats.

1 Like

Deleting the seat weld causes the player to be slidy?

Could it be that when the player is ejected from the seat there is some kind of bodyvelocity stuck in the character?

Only thing that keeps the player on the seat is “SeatWeld”, which is created when player has sat on the seat

I don’t remember if it automatically ejects u without making you slidy if you just remove the weld but I’m not sure,

You could also use humanoid.Jump = true once crashed and then lock the seat so it’s not accessible no more or just deleting it

Just guessing.
I know that when I’ve had vehicles that I’ve Anchored the VehicleSeat after a player jumps out of the seat it makes the vehicle Parts act like conveyors because the Parts that are welded to the Anchored seat have the value in the BasePart | Roblox Creator Documentation set at some random value it and looks a lot like what’s happening in the video.

Try humanoid.Jump = true, that just makes the player jump on command through a script and won’t make your character slidy

I’m assuming you’re using A-Chassis here right? I know because I work with it for buses. When a player sits in the seats of an A-Chassis vehicle. A bit of code in the core chassis script removes the mass from the player. Then when you jump out normally it restores it. But when that seat is deleted/SeatWeld. The script doesn’t have time to restore your mass resulting in you being that light that you slide about. At least that’s my theory. This is from my own visual observations.

2 Likes

Yeahp, I am using A-Chassis.

The script doesn’t delete the Seat or the SeatWeld of the character as it only ejects the player using occupant.Sit = false. I also have tried using occupant.Jump = true to no avail.

If it is the script removing the mass from the player, is it possible to manually add it back?

The script doesn’t delete the seat or seatweld but rather only make the player unsit or jump.

I’ve already tried using occupant.Jump = true but it didn’t work.

The Initialize script also does it, you would need to make the occupant.Sit false before you disable Initialize.

3 Likes

Ohh, I see.

Let me test it out.

2 Likes

This fixed the problem, Thanks!

2 Likes