Fabioxps Posted March 26, 2013 Share Posted March 26, 2013 how to put zoom on the camera, and stop at a target function StartCamera() local z = 100 setCameraMatrix(0,0,z,-1056.7127685547, 1042.8658447266, 38.503734588623) setTimer(function() z = z - 1 setCameraMatrix(0,0,z,-1056.7127685547, 1032.8658447266, 38.503734588623) end,1000,100) end addEventHandler("onClientRender", root, StartCamera) Link to comment
codeluaeveryday Posted March 26, 2013 Share Posted March 26, 2013 Your code is spamming the setTimer over and over and over and will never finish the loop. Let the best kid in town solve this problemo for you. Since it is a client sided code, it would be ok to use setTimer: function startZoom() z = 100 setCameraMatrix(0,0,z,-1056.7127685547, 1042.8658447266, 38.503734588623) setTimer(function() z = z - 1 setCameraMatrix(0,0,z,-1056.7127685547, 1032.8658447266, 38.503734588623) end, 50, 95) end addCommandHandler('zoom', startZoom) Couldn't fully decipher what you needed, so is this what you wanted? If this is what you wanted, just add startZoom() to wherever in your code you want it to begin, also you might want to remove the command handler. Link to comment
Fabioxps Posted March 26, 2013 Author Share Posted March 26, 2013 function startZoom() z = 100 setCameraMatrix(0,0,z,-1056.7127685547, 1042.8658447266, 38.503734588623) setTimer(function() z = z - 1 setCameraMatrix(0,0,z,-1056.7127685547, 1032.8658447266, 38.503734588623) end, 50, 95) end addEventHandler("onClientRender", getRootElement(), startZoom) what do this wrong? Link to comment
ZL|LuCaS Posted March 26, 2013 Share Posted March 26, 2013 function startZoom() z = 100 setCameraMatrix(0,0,z,-1056.7127685547, 1042.8658447266, 38.503734588623) setTimer(function() z = z - 1 setCameraMatrix(0,0,z,-1056.7127685547, 1032.8658447266, 38.503734588623) end, 50, 95) end addEventHandler("onClientRender", getRootElement(), startZoom) what do this wrong? That does not make sense Link to comment
codeluaeveryday Posted March 27, 2013 Share Posted March 27, 2013 Dude wTF, I've told you to not use onClientRender, it will spam and bug. Tell me what you are trying to do. Link to comment
Fabioxps Posted March 27, 2013 Author Share Posted March 27, 2013 Dude wTF, I've told you to not use onClientRender, it will spam and bug. Tell me what you are trying to do. I want to make camera zoom, and then stops. I want to use onClientRender Link to comment
DNL291 Posted March 27, 2013 Share Posted March 27, 2013 Does the 'z' argument will make zoom? I think you can use the last argument of this function. Also, you need to explain better what you want. 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