Here is the resource used to reproduce the bug : props.zip (1.1 MB)
The YTYP lr_prop_boathousedoor.ytyp is used to put object definitions.
Code used to spawn object :
function SpawnObject(model, coords, cb)
local model = (type(model) == 'number' and model or GetHashKey(model))
Citizen.CreateThread(function()
RequestModel(model)
while not HasModelLoaded(model) do
Citizen.Wait(0)
end
local obj = CreateObject(model, coords.x, coords.y, coords.z, true, false, true)
if cb ~= nil then
cb(obj)
end
end)
end
When I first load the game, I try to spawn my object ‘snail’ and nothing happens.
but the YTYP seems to be detected by FiveM :
-- CitizenFX.log
59406] coll open compcache:/props/lr_prop_boathousedoor.ytyp
Then I hit ESCAPE => Disconnect and I click on localhost menu item
Doing same thing and boom ! object can be spawned :