Client-Side created entities doesn't exist

local ent = ents.Create(“prop_physics”)
ent:SetPos(LocalPlayer():GetPos() + Vector(0,12,0))
Msg("ID: “…ent:EntIndex()…”
Msg outputs: -1
“ent” returns NULL Entity

I really don’t get why it doesn’t work…
It perfectly works creating Server-Side.

and how a “predicted” entity works ? I know there a few entities predicted, such as the vehicles, player movement…


Damn! How I haven’t seen that function before!?
thanks anyway…

Still doesn’t work…

Clientside models are affected by the garbage collector, store them in a table or something.

b_CEnt = ClientsideModel(“models/myproject/mymodel.mdl”, RENDERGROUP_OPAQUE)
b_CEnt:SetPos(LocalPlayer():GetPos() + Vector(0,12,0))

Still returns NULL Entity…

Isn’t that expected behavior? Ent indices are the same client and server-side so if you create a client-side only entity it gets an ent index of -1 to not mess up the system.
Does it error when you call :SetPos etc?

Yep, “Tried to use NULL Entity”