Hello guys,
I am trying to simulate a grenade throwing method and I came up with this:
xone = getobjectx(7)
yone = getobjecty(7)
zone = getobjectz(7)
xtwo = getcamerax(1)
ytwo = getcameray(1)
ztwo = getcameraz(1)
Create3DPhysicsDynamicBody(weaponslotsvar[currentweaponslot].currentweaponslotthrowngrenadeobject)
SetObject3DPhysicsLinearVelocity(weaponslotsvar[currentweaponslot].currentweaponslotthrowngrenadeobject, xone - xtwo, yone - ytwo, zone - ztwo, 700)
The problem is that when I rotate the camera, which the dummy object is attached like:
SetObjectPosition(7, getcamerax(1), getcameray(1), getcameraz(1))
SetObjectRotation(7, GetCameraAngleX(1), GetCameraAngleY(1), GetCameraAngleZ(1))
MoveObjectLocalX(7, 0.1)
MoveObjectLocalY(7, 0.5)
MoveObjectLocalZ(7, 25)
The cloned object slightly rotates depending on the camera's angle and it deviates the object's direction.
Can someone, kindly, provide me with some tips or some correction on how can I throw the object without altering it's rotation like that?
Thank you very much!
www.alexmatei.com