Jump to content

setVehicleComponentRotation Problem


Recommended Posts

Hey guys,

In a model I've added a custom vehicle component (gearflapleft)

What it is supposed to do is rotate 90 degrees when I press u. This works perfectly, however,

It also scales the component about three times larger. 

What's going on here?

function shamalFunctions()
    local vehicle = getPedOccupiedVehicle(localPlayer)
	local x, y, z = getVehicleComponents(vehicle, "gearflapleft" )
    if(vehicle)then
        if getElementModel(vehicle) == 519 then 
	        local rx, ry, rz = getVehicleComponentRotation(vehicle, "gearflapleft")
		    setVehicleComponentRotation(vehicle, "gearflapleft", rx, ry+90, rz)
		end	 
	end
end
bindKey("u", "down", shamalFunctions)

Pics for a better explanation:

https://gyazo.com/a41f4801a76a3894671452f0598ac814

https://gyazo.com/b399008953774d5216db6f30f9895dde

Thanks for your help!

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...