Hello I am new to Hero Engine, I followed to FPS Camera Tutorial on the wiki which at the end gave the code
function PushAndActivateFPS_CameraLayer()
PushCmdLayer("FPS_Camera")
ActivateCmdLayer("FPS_Camera", true)
.
function DeactivateFPS_CameraLayer()
ActivateCmdLayer("FPS_Camera",false)
.
function SetupFPS_Camera()
camera as NodeRef = AddCamera("FPS_Camera")
character as NodeRef = GetPlayerCharacterNode()
character_position as Vector3
GetNodePosition( character, character_position )
SetCameraPosition( "FPS_Camera", character_position )
character["Render"] = false
SetCameraFollow( "FPS_Camera",character )
SetCameraOffset( "FPS_Camera", 0.0 )
FreeLook( "FPS_Camera", true )
ActivateCamera( "FPS_Camera")
.
function onmouseleaveviewport()
println("Left viewport in fps_camera")
.
function OnMouseClick(lmb as Boolean, rmb as Boolean, mmb as Boolean, mb4 as Boolean, mb5 as Boolean) as Boolean
println("Click")
return false
.
function onMouseMove(mx as Integer, my as Integer, dx copies Integer, dy copies Integer) as Boolean
println("Moving the mouse")
if (GetTweakableBoolean("GameInvertMouseX")) or $INPUT._InputGameInvertMouseX
dx = dx * -1
.
if (not GetTweakableBoolean("GameInvertMouseY")) and ( not $INPUT._InputGameInvertMouseY )
dy = dy * -1
.
fx as Float = dx
fy as Float = dy * -1
if $INPUT._InputGameMouseSensitivity > 0
fx = fx * $INPUT._InputGameMouseSensitivity
fy = fy * $INPUT._InputGameMouseSensitivity
.
camera as NodeRef = GetActiveCamera()
RotateNode(camera,fy,fx,0)
return true
.
function StartFPS_Camera()
PushAndActivateFPS_CameraLayer()
SetupFPS_Camera()
.
I understand what the code is doing and all but I try to call the StartFPS_Camera() function through the console to test the code and I get nothing. I used the call command as stated in the wiki by typing:
CALL FPS_Camera_Callback StartFPS_Camera
and nothing happens. The console doesn't kick out any errors but the camera doesn't change at all either. Is there something I missed?