Exit a VehicleSeat to a designated position

Ok, the ‘wait(0.1)’ thing was no use, it made me teleport to the same place, and I tried the script out in a seat. I found out that the cause of the fling was because the seat teleported when I jumped.

So as of now, what’s the main issue going on that needs to be fixed?

The seat teleporting instead of the character.

Maybe try adding a longer wait? Or I believe you can remove the SeatWeld as well.First, try a long wait such as 0.5 or longer, if that doesn’t work, can you check the Character model for where the weld that is created between the character and the seat is located when sitting?

The weld is in the seat, but it only appears whenever the character sits on it.

What is the name of it? I think we can remove it when the occupant is removed, Not sure, but try waiting first to see if that’ll work

After jumping off the seats, I noticed something in particular. If there’s no wait, the seat teleports. But if it does, the character teleports. The wait thing fixed it, but I noticed that both the seat and character teleported to the same spot when I was testing it.

It’s probably then that the weld is still on the Character when teleporting, what’s the name of the weld?

There’s no weld in the Player’s model, only the seat has it. But if you don’t know the name of the seat’s weld, it’s called the ‘SeatWeld

Try this?

local seat = --Your seat

local formerOccupant

seat:GetPropertyChangedSignal("Occupant"):Connect(function()
	local hum = seat.Occupant
	
	if hum then
		formerOccupant = hum.Parent
	elseif not hum and formerOccupant and formerOccupant:FindFirstChild("HumanoidRootPart") then
		seat.SeatWeld:Destroy()
		formerOccupant.HumanoidRootPart.CFrame = seat.CFrame.RightVector * -5
        formerOccupant = nil
	end
end)

Nope, it didn’t work. I think the problem has to do with the seat.CFrame.RightVector, but I’m not so sure whether I know what I’m talking about or not.

Could be, maybe try out this?

local seat = --Your seat

local formerOccupant

seat:GetPropertyChangedSignal("Occupant"):Connect(function()
	local hum = seat.Occupant
	
	if hum then
		formerOccupant = hum.Parent
	elseif not hum and formerOccupant and formerOccupant:FindFirstChild("HumanoidRootPart") then
		seat.SeatWeld:Destroy()
		wait(1)
		formerOccupant.HumanoidRootPart.CFrame = CFrame.new(formerOccupant.HumanoidRootPart.CFrame.RightVector * -5)
        formerOccupant = nil
	end
end)

I’m not sure if a wait also has to be involved as well

Try making a part that is anchored, next to the car but not touching it, and is CanCollide false, next, check if the player is sitting, if true then check if the player pressed space bar, if true then set the players HumanoidRootPart.Position to that part, make the part fairly high in the air, like the height that the car is at, and to the side

This is similar to the attachment thing in the SUV model from reference 2, but I don’t really know how to detect the jump and other things that you mentioned. Would you mind making one?

It still has the same problem.

local LocalPlayer = game:GetService("Players"). LocalPlayer
local jp = game.Workspace.Car.Seat.jumppart
local Character = LocalPlayer.Character
local hrp = Character.HumanoidRootPart
local humanoid = Character.Humanoid

if humanoid.Sit and Seat.Occupant then
hrp.Position = jp.Position
end
1 Like

Oh yeah, and that might not even work

I was testing something out myself and I think this should work?

local seat = script.Parent

local formerOccupant

seat:GetPropertyChangedSignal("Occupant"):Connect(function()
	local hum = seat.Occupant

	if hum then
		formerOccupant = hum.Parent
	else
		wait()
		formerOccupant.HumanoidRootPart.CFrame = seat.CFrame + (seat.CFrame.RightVector * -5)
		formerOccupant = nil
	end
end)

Replace script.Parent with the location of your seat

6 Likes

i would say the best way is to add an attachment or a part and weld it to the seat and put the exit cframe following the part/attachment’s CFrame

1 Like

It would be a bit more hassle than needed, we already have properties such as RightVector to help with positioning, I tried that code out myself, it was working fine for me, so I think it should work for him as well

1 Like