Create props and apply gravity

Hi,

I would like to create an object at a specific height above the ground. (Entity created on the server side using onesync). So far, so good.

I would now like to apply physics to this object so that it falls naturally to the ground. Today it stays stuck at a height. The object is created with a freezed position, but as soon as the entity gets an owner, it defreezes the position.

I have tried to use native SetEntityHasGravity - FiveM Natives @ Cfx.re Docs but no succes.

If anyone has an idea, I’m open to it.

regards,

1 Like

SetEntityCollision might be what you’re looking for, though note that it kind of sounds like the object you’re spawning might not have collisions

Hello,

I have tried what you proposed, but it crashes the client (even though I request collisions beforehand). However, I have found a solution in a script that uses the following natives:

Thanks you very much.