GetCameraTarget: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
| Line 20: | Line 20: | ||
| * Returns an [[element]] of the target if the function was successful, or ''false'' if bad arguments were specified | * Returns an [[element]] of the target if the function was successful, or ''false'' if bad arguments were specified | ||
| {{New feature|3|1.0| | {{New feature|3|1.0| | ||
| * Returns ''false'' if the camera is in Fixed mode and has no target | * Returns ''false'' if the camera is in Fixed mode and has no target. | ||
| }} | }} | ||
Revision as of 18:18, 5 March 2010
This function returns an element that corresponds to the current target of the specified player's camera (i.e. what it is following).
Syntax
Click to collapse [-]
Serverelement getCameraTarget ( player thePlayer )
Required Arguments
- thePlayer: The player whose camera you wish to receive the target of.
Click to collapse [-]
Clientelement getCameraTarget ()
Returns
- Returns an element of the target if the function was successful, or false if bad arguments were specified
- Returns false if the camera is in Fixed mode and has no target.
Example
This example checks whether a player's camera's target is another player, and returns true or false accordingly.
Click to collapse [-]
Server scriptfunction isTargetPlayer( thePlayer )
    local target = getCameraTarget ( thePlayer )
    if ( getElementType ( target ) == "player" ) then   -- If target is a player
        return true                                     -- Return true
    else
        return false                                    -- Otherwise, return false.
    end
end
See Also
- fadeCamera
- getCameraInterior
- getCameraMatrix
- getCameraTarget
- setCameraInterior
- setCameraMatrix
- setCameraTarget