I am trying to make a script where when the player sits in a seat, the collision will be off,
I am trying to make where vehicles can go thru each other, but it gets stuck when it gets to the player.
I have tried a script, but it does not work, anyone have any idea how to make a script when the player is seated the collision will be off so that other vehicles can go thru it.
You could try detecting a state change in the Humanoid, and assigning a collision group to all the parts in the character. You could also assign to the vehicle, but you’d probably want vehicles to collide with each other?
local char = Player.Character or Player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local tempCharacterCollisionGroup = "temp"
local function onStateChanged(old: Enum.HumanoidStateType, new: Enum.HumanoidStateType): nil
if new == Enum.HumanoidStateType.Seated then --player sat down
for _, part in next, char:GetDescendants(), nil do
if part:IsA("BasePart") then
part.CollisionGroup = tempCharacterCollisionGroup
end
end
else
for _, part in next, char:GetDescendants(), nil do
if part:IsA("BasePart") then
part.CollisionGroup = "Default"
end
end
end
end
hum.StateChanged:Connect(onStateChanged)
Yes i already have that, but my vehicle stops when it gets at the body of the caracter, and i need the caracter to be able to get on the vehicle because it is high.