Jump to content

camera zoom


Fabioxps

Recommended Posts

Posted

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) 

Posted

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.

Posted
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?

Posted
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

Posted
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

Posted

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.

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