I just noticed that the util.TraceLine function seams to be broken. It never returns any entity parented to another entity.
Here is my code
[code]
//veh is a TDMCars vehicle
//ply is the player who pressed use on this vehicle (named veh)
//Hook is GM:PlayerUse
local dist = ply:GetPos():Distance(veh:GetPos())
if (dist <= 100) then
local pos = ply:GetEyeTrace().HitPos
local result = util.TraceLine({start = pos, endpos = (pos + (ply:GetForward() * 192)), filter = veh, mask = MASK_SOLID, ignoreworld = false})
if (IsValid(result.Entity) and result.Entity:GetClass() == "prop_vehicle_prisoner_pod") then
ply:EnterVehicle(result.Entity)
end
else
print(dist) //This was to be sure the distance between the vehicle and me was not in cause
end
[/code]
No, it's not. That's how parenting works. Parented entities do not have any physics, they are not solid.
[editline]17th February 2015[/editline]
As a result, trace cannot hit it.
So there's no way to make passenger system working then...
Sorry, you need to Log In to post a reply to this thread.