I’m in the process of having peds go to specific locations based off criteria, however because this “go to coords” function is being called every second, it seems to cause the ped to stop and jitter while heading to the location, rather than simply walking along smoothly.
Is there any particular way i might check if the ped already has a certain task, or check if they’ve already been programmed to head to a specific location?
I’m sure there’s workarounds like “well if the distance to the waypoint is getting less, so they MUST be walking there”, but that seems far too messy.
If the only thing you want to do is making the ped walk to a certain coord (with no other tasks) you could just make a boolean like for example:
local IsGoing = false
Citizen.CreateThread(function()
while true do
Citizen.Wait(7)
if not IsGoing then
TaskGoStraightToCoord() -- change ur stuff here
IsGoing = true
-- may use a return as well if you want to break the loop
end
end
end)