Hello, I have a huge problem currently. My NPCs are jumping out of the seats:
If I have the “vehicle_root” on collide, the NPCs will jump, otherwise, not. I have no clue as to why this is happening, I even hard locked the NPCs, either welding, stopping the jumps, or having a collission groups system wherein NPCs can’t hit the car, or the car can’t hit the NPCs. But the wacky solution is to have the vehicle_root’s/any part in the vehicle’s collisions off.
My script is kind of long, but if needed, I’ll post it. To summarize the suspect/s other than the collides:
I’m using SimplePath as the main way for NPCs to walk. - I also stopped the path if they’re in a seat.
Other relevant info:
All Seats have CanQuery off.
If there is a part below the seat that has CanCollide to true, problem begins.
Goal
What I need is the vehicle_root to have collisions, if not, it would result in weird stuff where the car could squeze through alleyways only made for humanoids. That’s one of the problems, the other is that the car would phase through the world and disappear.
Addendum:
Further testing only confirms that if there are any part that is kind of below the problem starts.
you can go into the script which causes the NPCs to even jump at all, and check if they’re sitting. if they are, you should not let the NPC jump, if they aren’t then they shouldn’t. if you have a reason for this not to work, could you send me the script where the NPC jumps?
alternatively, you can monitor the Humanoid properties of the NPCs and see if the Sit property even changes.
I found the problem. From the looks of it, SimplePath is calling a jump for some odd reason:
--Make NPC jump
local function setJumpState(self)
pcall(function()
if self._humanoid:GetState() ~= Enum.HumanoidStateType.Jumping and self._humanoid:GetState() ~= Enum.HumanoidStateType.Freefall then
self._humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end
end)
end
Fixed my problem by checking if the Humanoid is NOT seated, then it can jump.
--Make NPC jump
local function setJumpState(self)
pcall(function()
if self._humanoid:GetState() ~= Enum.HumanoidStateType.Jumping and self._humanoid:GetState() ~= Enum.HumanoidStateType.Freefall and not self._humanoid.Sit then
self._humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end
end)
end