Hi there,
Im currently attaching a v_med_emptybed to my player’s PED using AttachEntityToEntity, but my bed does not have any collision whatsoever. It even ignores the world’s collision detection.
I tried to set it’s collision using SetEntityCollision(brancard, true, true), but to no avail as the screenshot above shows.
https://runtime.fivem.net/doc/natives/#_0x6B9BBD38AB0796DF
void AttachEntityToEntity(int /* Entity */ entity1, int /* Entity */ entity2, int boneIndex, float xPos, float yPos, float zPos, float xRot, float yRot, float zRot, bool p9, bool useSoftPinning, bool collision, bool isPed, int vertexIndex, bool fixedRot);
one of the arguments is bool collision
have you tried setting that to true?
Yeah that too.
Here is my attachentitytoentity line:
AttachEntityToEntity(brancardObject ,PlayerPedId(source), GetPedBoneIndex(PlayerPedId(source), 28422), 0.0, -1.1, -0.95, 195.0, 180.0, 180.0, 0.0, false, false, true, false, 2, true)
The 4th to last param is true, so the collision should be true?
Well I just read the description. That argument only controls the collision between the 2 attached entities.
collision - controls collision between the two entities (FALSE disables collision).
Maybe someone will come through and see it and know how to do it as I do not unfortunately. Especially if the collision native didn’t work.
Hmm alright, thanks anyways xander for trying to help 
If I hear anything about it I will let you know.
1 Like
To make this issue even weirder.
Whenever I wiggle my bed through the car, it will register the collision after 2-3 seconds. Seems to work whenever the PED model walks towards the car. If the PED is close enough, it will update the collision constraint it seems.
Does the actual prop have collisions? Try opening it in zmodeler3 and see - that might be your issue
Alternatively I guess you could try these natives:
REQUEST_COLLISION_FOR_MODEL
https://runtime.fivem.net/doc/natives/#_0x923CB32A3B874FCB
REQUEST_ADDITIONAL_COLLISION_AT_COORD
https://runtime.fivem.net/doc/natives/#_0xC9156DC11411A9EA
1 Like
Pretty sure it has to do with the AttachEntityToEntity native if you attach a car it loses collisions im pretty sure I had that same thing happen in my towtruck.
Try this native https://runtime.fivem.net/doc/natives/#_0xC3675780C92F90F9 to see if it effects the collisions to the world. No idea if it does or not as I have never used that version of attaching.
1 Like
I cant open the file in zmodeler, its whining about not having the correct license eventhough im registered?
Ive tried this aswell, but to no avail 