Hi,
I have a little problem. I would use the GBA_StrateLeft and the GBA_TurnLeft on the same bind and put a condition. I want to use only the GBA_StrateLeft while my CameraStyle == 'ThirdPerson' and only GBA_TurnLeft while my while my CameraStyle == 'FreeCam'.
I've tried all that i can do but i didnt found the answer.
I would find something like that :
Here is my full PlayerController:
Thanks for you help.
I have a little problem. I would use the GBA_StrateLeft and the GBA_TurnLeft on the same bind and put a condition. I want to use only the GBA_StrateLeft while my CameraStyle == 'ThirdPerson' and only GBA_TurnLeft while my while my CameraStyle == 'FreeCam'.
I've tried all that i can do but i didnt found the answer.
I would find something like that :
Code:
exec function GBA_StrafeLeft()
{
if (YourGameCamera(PlayerCamera).CameraStyle == 'FreeCam')
{
return;
}
}
exec function GBA_TurnLeft()
{
if (YourGameCamera(PlayerCamera).CameraStyle == 'ThirdPerson')
{
return;
}
}
Here is my full PlayerController:
Code:
class YourGamePlayerController extends GamePlayerController;
var float PreDist; //tore our previous camera distance so that when we switch back to the normal camera, we'll be at our original setting.
exec function NextWeapon()
{
if (PlayerCamera.FreeCamDistance < 512)
{
PlayerCamera.FreeCamDistance += 64*(PlayerCamera.FreeCamDistance/256);
}
}
exec function PrevWeapon()
{
if (PlayerCamera.FreeCamDistance > 64) //Checking if the distance is at our minimum distance
{
PlayerCamera.FreeCamDistance -= 64*(PlayerCamera.FreeCamDistance/256); //Once again scaling the zoom for distance
}
}
exec function GBA_StrafeLeft()
{
if (YourGameCamera(PlayerCamera).CameraStyle == 'FreeCam')
{
return;
}
}
exec function GBA_TurnLeft()
{
if (YourGameCamera(PlayerCamera).CameraStyle == 'ThirdPerson')
{
return;
}
}
exec function ShoulderCam()
{
PreDist = PlayerCamera.FreeCamDistance; //Storing our previous camera distance...
YourGameCamera(PlayerCamera).CameraStyle = 'ThirdPerson'; //Type casting our camera script to access the variable CameraStyle
}
exec function ReturnCam()
{
PlayerCamera.FreeCamDistance = PreDist; // Restoring the previous camera distance
YourGameCamera(PlayerCamera).CameraStyle = 'FreeCam'; // Restoring the previous camera style
}
DefaultProperties
{
CameraClass=class 'YourGameCamera' //Telling the player controller to use your custom camera script
DefaultFOV=90.f //Telling the player controller what the default field of view (FOV) should be
}
Thanks for you help.