Hey, I came across the same issue. Here are my results after testing a bit:
Client
Using canary? Yes
Windows Version: Windows 10 Pro 20H2
Server
Operating System: Windows (artifact 3431) and Linux (artifact 3435)
Windows was localhost, Linux was remote server
Resources: only default resources and my test resource. Link below.
Game Build: 2189 and default
Incident
Steps to reproduce
- Objects gets spawned by the server via
CreateObjectNoOffset
- The Object appears at the specified location.
- If the client leaves the area, the object disappears.
Maybe important info:
- The client shows missionEntity=false for the server-sided spawned entity.
- The Lod of the Object can be edited by the client with
SetEntityLodDist
, but the Lod doesn’t change.
- FXServer version 3383 doesn’t have the bug, and even the Lod Distance can be changed.
- In the latest server artifact versions (see version above), the object disappears at a much lower range. In 3383 the distance before the object is unloaded for me is much higher.
My test resource (Download Link at the end)
Client
let latestObject = 0;
onNet("test:newobject", function (networkId) {
latestObject = networkId;
})
setInterval(function () {
if (latestObject) {
let entity = NetworkGetEntityFromNetworkId(latestObject);
let networkIdExists = NetworkDoesNetworkIdExist(latestObject);
showTextOnScreen("networkId: " + latestObject + ", entity: " + entity + ", networkIdExists: " + networkIdExists, 0.2, 0.2);
}
}, 1);
function showTextOnScreen(text, x, y) {
SetTextFont(0)
SetTextProportional(1)
SetTextScale(0.0, 0.4)
SetTextColour(255, 255, 255, 255)
SetTextDropshadow(0, 0, 0, 0, 255)
SetTextEdge(1, 0, 0, 0, 255)
SetTextDropShadow()
SetTextOutline()
SetTextEntry("STRING")
AddTextComponentString(text);
DrawText(x, y)
}
Server
RegisterCommand("spawn", async function (source, args) {
let ped = GetPlayerPed(source);
let coords = GetEntityCoords(ped);
let object = CreateObjectNoOffset("prop_barrier_work06a", coords[0], coords[1], coords[2], true, true, true);
let i = 0;
while (!DoesEntityExist(object) && i++ < 100) {
await Delay(1);
}
if (!DoesEntityExist(object)) {
console.log("couldn't create object.");
return;
}
let networkId = NetworkGetNetworkIdFromEntity(object);
console.log("created object " + object + " with networkId " + networkId);
emitNet("test:newobject", -1, networkId);
})
Video
Test-Resource
objecttest.zip (1.5 KB)