Jump to content

Getting camera target


Wisam

Recommended Posts

Hello..

I started making assault maps for my server for assault gamemode and there is one thing i cant get for the map and its the camera target.. i want to know the cordnaits for the the camera target and where to look..

Like this

6eUUvHS.png?1

The map script:

This is part of the map script for the camera target

    "-1448.827026" posY="1503.699585" posZ="25.376719" 
        targetX="-1385.593750" targetY="1491.384277" targetZ="12.064482" type="selectTeam" /> 

My guess was that the camera pos is where the camera will be, and the target pos is the cordniats where the camera will look, but i didnt try it.. if you know anything about this please help me :)

Thank you

Link to comment
  • Moderators
local cameraElements= getElementsByType("camera") 
local firstArray = next(cameraElements) 
if firstArray then 
local camera = cameraElements[firstArray] 
local posX = getElementData(camera,"posX") 
-- etc. 
end 

Link to comment

Add this client-side and use /dump to dump the camera coordinates. They will be copied to your clipboard so you just use CTRL+V somewhere.

  
addCommandHandler("dump",function() 
    local x,y,z,lx,ly,lz = getCameraMatrix() 
    setClipboard(tostring(x)..","..tostring(y)..","..tostring(z)..","..tostring(lx)..","..tostring(ly)..","..tostring(lz)) 
end) 
  

Link to comment
Add this client-side and use /dump to dump the camera coordinates. They will be copied to your clipboard so you just use CTRL+V somewhere.
  
addCommandHandler("dump",function() 
    local x,y,z,lx,ly,lz = getCameraMatrix() 
    setClipboard(tostring(x)..","..tostring(y)..","..tostring(z)..","..tostring(lx)..","..tostring(ly)..","..tostring(lz)) 
end) 
  

That didnt work its gives me an error ! and its not copying

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