rusztamas Posted April 1, 2017 Share Posted April 1, 2017 Hi! I want to use smoothMoveCamera, but i don't really understand how. function moveCamera() local deathX, deathY, deathZ = getElementPosition(source) setCameraMatrix (deathX, deathY, deathZ, deathX, deathY, deathZ+50) end addEventHandler ("onPlayerWasted", getRootElement(), moveCamera) The thing i want to do, it to move from deathZ to deathZ+50 in for example 30 seconds, and i think i can use smoothMoveCamera for this, but i dont know how. Could you please help me? Link to comment
NeXuS™ Posted April 1, 2017 Share Posted April 1, 2017 (edited) You could use interpolateBetween for it. function moveCamera() deathX, deathY, deathZ = getElementPosition(source) setCameraMatrix (deathX, deathY, deathZ, deathX, deathY, deathZ+50) startingTime = getTickCount() timeToFinish = 10000 end addEventHandler ("onPlayerWasted", getRootElement(), moveCamera) addEventHandler("onClientRender", getRootElement(), function() local progressC = (getTickCount() - startingTime)/timeToFinish local cX, cY, cZ = interpolateBetween( 0, 0, deathZ 0, 0, deathZ+50 progressC, "InOutQuad") setCameraMatrix(deathX, deathY, cZ) end) I think this one should work. Edited April 1, 2017 by NeXuS™ Link to comment
rusztamas Posted April 1, 2017 Author Share Posted April 1, 2017 SCRIPT ERROR: koth\koth.codeS_Death.lua:13: ')' expected (to close '(' at line 11) near '0' Link to comment
NeXuS™ Posted April 1, 2017 Share Posted April 1, 2017 (edited) Buddy, you gotta start checking the scripts, because these errors are easy to fix. local cX, cY, cZ = interpolateBetween( 0, 0, 0, deathZ, 0, 0, deathZ+50, progressC, "InOutQuad") setCameraMatrix(deathX, deathY, cZ) Edited April 1, 2017 by NeXuS™ 1 Link to comment
rusztamas Posted April 1, 2017 Author Share Posted April 1, 2017 Now it writes no errors, but nothing is happening after i die. Just the simple gta-sa "shaking" animation. Link to comment
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