Jump to content

object rotation in attachElements?


cokacola

Recommended Posts

hello, i seem to have a problem. Well, i am attaching a cargo ship to my boat but no matter what i do, it always spawns with the side of the boat facing me, so the boat goes sideways..

theCargo = createObject(10230, 1016.2437133789, -2473.1711425781, 6.6930656433105, 0, 10, 0)
 
function attachCargo(thePlayer)
local car = getPedOccupiedVehicle(thePlayer)
if(car) then
	local rx, ry, rz = getVehicleRotation(car)
	setObjectRotation(theCargo, rx, ry, rz)
	attachElements(theCargo, car, 0, -25, 0)
	setObjectRotation(theCargo, rx, ry, rz)
	outputChatBox("Here is the cargo!", thePlayer)
else
	outputChatBox("This function only works in vehicles.", thePlayer)
end
end
addCommandHandler("cargo", attachCargo)

i have tried every form of rotation i could, and even, like above, setting the boats roation on the cargo ships rotation.

so does anyway know how the fix this annoying bug?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...