Xwad Posted January 25, 2016 Posted January 25, 2016 Hi. Is it possible to use players camera to rotate an objects? I mean for example: if i move the player camera right then the object will rotate right too. is this possible? if yes what functions need i use? thanks.
KariiiM Posted January 25, 2016 Posted January 25, 2016 If I understand what you means, you've to use the usefull function, findRotation
Castillo Posted January 25, 2016 Posted January 25, 2016 https://wiki.multitheftauto.com/wiki/Ge ... raRotation Maybe that could work?
Xwad Posted January 25, 2016 Author Posted January 25, 2016 i dont really understand this function.. Can yoou make me an example pls?
Xwad Posted January 25, 2016 Author Posted January 25, 2016 (edited) Is it good? local weapon = createWeapon("m4", -2376.80, -578.50, 132.3) setWeaponState(weapon, "ready") Function bindFire () local rotX, rotY, rotZ = getElementRotation(weapon) local x, y, z = getElementPosition (weapon) local x, y, z = getElementPosition(source) local rotX, rotY, rotZ = getElementRotation(source) setElementRotation(weapon, findRotation(x,y,rotX,rotY) ); end addEvent( "bindFire", true ) addEventHandler( "bindFire", localPlayer, bindFire ) Edited January 27, 2016 by Guest
Xwad Posted January 27, 2016 Author Posted January 27, 2016 Please help me:( this is the last think i need to finish my script
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now