Posted: 2nd May 2023 7:24
So I am using a small function to equip and unequip weapons.

It fixes the object to the correct bone just fine and everything is perfect but then when i take it off, it stays at the same rotation and location as my player object as it never un fixed so to say.

So to fix a object to a bone works, but to unfix a object to a bone does not work, it just stays at the same pos and rotation and also movement.

I do not know why but when I unfix a object from a object it works, but not with bones.

+ Code Snippet
function playerweapons()

if GetRawMouseMiddlePressed()=1 then playerisarmed=1
if GetRawMouseRightReleased()=1 then playerisarmed=0

if playerisarmed=1
FixObjectToBone( staff, player, 34 )
hasNoWeapon=0
hasMagicStaff=1
endif

if playerisarmed=0
FixObjectToBone( staff, 0, 0 )
hasNoWeapon=1
hasMagicStaff=0
endif

endfunction
Posted: 3rd May 2023 7:55
I figured this out so never mind.

Instead of

FixObjectToBone( staff, 0, 0 )

You have to use

FixObjectToObject( staff, 0 )

I guess you have to unfix it with a different command.