Jump to content

Camera remove "start"


Fabioxps

Recommended Posts

all right but when you press f6 camera not back to the start why?

local visible = true 
  
setCameraMatrix (117.5101852417, 163.30557250977, 5579.2065429688, 116.48139190674, 156.49519348145, 5579.0087890625) 
  
local progress = 0.0;  
function aa() 
    if progress < 1 then 
        progress = progress + 0.002; -- increase to move the camera faster 
    end 
    local x, y, z = interpolateBetween( 117.5101852417, 163.30557250977, 5579.2065429688, 120.94383239746,162.29713439941,5579.5678710938, progress, "Linear" ); 
    setCameraMatrix (x, y, z, 116.48139190674, 156.49519348145, 5579.0087890625) 
end 
addEventHandler("onClientRender",root, aa) 
  
  
bindKey("F6","down", 
    function() 
        if visible then 
            removeEventHandler("onClientRender",root, aa) 
            visible = false 
  
                     else  
            addEventHandler("onClientRender",root, aa) 
            visible = true 
        end     
end) 

Link to comment

Try this.

bindKey("F6","down", 
    function() 
        if visible == true then 
            removeEventHandler("onClientRender",root, aa) 
            setCameraMatrix (117.5101852417, 163.30557250977, 5579.2065429688, 116.48139190674, 156.49519348145, 5579.0087890625) 
            visible = false 
        else 
            addEventHandler("onClientRender",root, aa) 
            visible = true 
        end     
end) 

Link to comment

You must return the camera to the local player using setCameraTarget.

local visible = true 
setCameraMatrix ( 117.5101852417, 163.30557250977, 5579.2065429688, 116.48139190674, 156.49519348145, 5579.0087890625 ) 
local progress = 0.0; 
  
function aa ( ) 
    if ( progress < 1 ) then 
        progress = progress + 0.002; -- increase to move the camera faster 
    end 
    local x, y, z = interpolateBetween ( 117.5101852417, 163.30557250977, 5579.2065429688, 120.94383239746,162.29713439941,5579.5678710938, progress, "Linear" ); 
    setCameraMatrix ( x, y, z, 116.48139190674, 156.49519348145, 5579.0087890625 ) 
end 
addEventHandler ( "onClientRender", root, aa ) 
  
bindKey ( "F6", "down", 
    function ( ) 
        if ( visible ) then 
            removeEventHandler ( "onClientRender", root, aa ) 
            setCameraTarget ( localPlayer ) 
            visible = false 
        else 
            addEventHandler ( "onClientRender", root, aa ) 
            visible = true 
        end     
    end 
) 

Link to comment
You must return the camera to the local player using setCameraTarget.
local visible = true 
setCameraMatrix ( 117.5101852417, 163.30557250977, 5579.2065429688, 116.48139190674, 156.49519348145, 5579.0087890625 ) 
local progress = 0.0; 
  
function aa ( ) 
    if ( progress < 1 ) then 
        progress = progress + 0.002; -- increase to move the camera faster 
    end 
    local x, y, z = interpolateBetween ( 117.5101852417, 163.30557250977, 5579.2065429688, 120.94383239746,162.29713439941,5579.5678710938, progress, "Linear" ); 
    setCameraMatrix ( x, y, z, 116.48139190674, 156.49519348145, 5579.0087890625 ) 
end 
addEventHandler ( "onClientRender", root, aa ) 
  
bindKey ( "F6", "down", 
    function ( ) 
        if ( visible ) then 
            removeEventHandler ( "onClientRender", root, aa ) 
            setCameraTarget ( localPlayer ) 
            visible = false 
        else 
            addEventHandler ( "onClientRender", root, aa ) 
            visible = true 
        end     
    end 
) 

but the camera is not coming back to the beginning castilho

Link to comment

Still not 100% sure what your asking but I assume it might be this.

bindKey("F6","down", 
    function() 
        if visible == true then 
            x, y, z = nil, nil, nil 
            progress = 0 
            setCameraMatrix (117.5101852417, 163.30557250977, 5579.2065429688, 116.48139190674, 156.49519348145, 5579.0087890625) 
            visible = false 
             removeEventHandler("onClientRender",root, aa) 
        else 
            addEventHandler("onClientRender",root, aa) 
            visible = true 
        end     
end) 

Link to comment
Still not 100% sure what your asking but I assume it might be this.
bindKey("F6","down", 
    function() 
        if visible == true then 
            x, y, z = nil, nil, nil 
            progress = 0 
            setCameraMatrix (117.5101852417, 163.30557250977, 5579.2065429688, 116.48139190674, 156.49519348145, 5579.0087890625) 
            visible = false 
             removeEventHandler("onClientRender",root, aa) 
        else 
            addEventHandler("onClientRender",root, aa) 
            visible = true 
        end     
end) 

solved thank OGF and Castilho

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