Creating doors through scripts with CreateObject native

I’ve spent a while trying to spawn doors at run time and have them act as normal doors, when spawning a door and it will fall to the ground when you try to walk through it. I’ve tried attaching it to another object, this makes the door frozen and doesn’t move. I can not find any natives that may freeze position but allow for rotations or something, also tried searching around but have only found ‘door creator’ scripts that use existing doors in the map. Any help would be much appreciated.

How you create your object?
CreateObject - FiveM Natives @ Cfx.re Docs
you can see in here

doorFlag 

you need to set this to true

Yes that’s been true the whole time, just odd they have a flag for a door spawn but it doesn’t actually work


The object is created on the server as well

Once you create it, have you tried to add it to the GTA Door System?
Try using AddDoorToSystem and all the other natives about the doors. Just search ‘door’ here and go to the ‘OBJECT’ namespace


Yep


This is the end result with the door being attached to the frame around it, but it’s frozen.
Also tried the unknown bool to true and false, and soft pinning true/false

Any solution?