Why vehicles keep despawning?

Hello everyone, do you know why vehicles keep despawning ? I thought of blocking mysql who can cause some sort of de-sync but really I have no idea. Here is my code to spawn a vehicle :

local vehicle = CreateVehicle(vehicleModel, coords.x, coords.y, coords.z, 90.0, true, true)
SetVehicleHasBeenOwnedByPlayer(vehicle,  true)
SetEntityAsMissionEntity(vehicle,  true,  true)
local id = NetworkGetNetworkIdFromEntity(vehicle)
SetNetworkIdCanMigrate(id, true)

Setting them as Mission Entity lets them despawn.

Ok, so if I remove this i’ll be fine ?

It should be. Just give it a try.

if it is not working, check your other resources. Maybe one of them deletes them. For example CarCleanUp from Mr.Scammer.

Ok, i will check. Thank you !

1 Like

Don’t use true, true in vehicle creation unless you have good reason to.

Okay, thanks for the tip.

Is anyone still having his issue because we’ve done everything we can to isolate the issue. We started fresh with essential 2.0 freeroam 1.3 ply_garages ply_prefeture and they still despawn

Player buys a car, drives it up the street to register and after that they drive down the road and poof gone…

nope having the same issue cant find a fix unfortunately.