My player camera currently doesn’t appear to actually move. It seems to work fine as it’s still updating to POV.
However I just tried using PlayWorldCameraShake() in Camera.uc. This calls CalcRadialShakeScale() which checks the player camera location to determine if the shake should play for the viewing player.
However shouldn’t this be calling PlayerController::GetPlayerViewPoint() to get the player POV location? As the camera location never changes after it’s spawned.
Or have I done something that is preventing my player camera actor from following my player controller?
The way I ended up doing camera shakes in my game was manually getting the distance from the POV, and then checking to see whether the critical hit happened close enough to the camera.
When a pawn scores a critical hit
PlayerCameraViewLocation = GetALocalPlayerController().PlayerCamera.ViewTarget.POV.Location;
Intensity = (10000000 - VSizeSq(location - PlayerCameraViewLocation) ) / 8000000;
if(Intensity > 1) Intensity = 1;
if(Intensity > 0) RPGTacPlayerController(GetALocalPlayerController()).CriticalCameraShake(Intensity);
And then in my player controller…
exec function CriticalCameraShake(float Intensity)
{
Intensity *= 0.35; // Fine-tune intensity of camera shake.
PlayerCamera.PlayCameraShake(CriticalShake, Intensity);
}
And in the player controller’s default properties:
Begin Object Class=CameraShake Name=Shake0
bSingleInstance=true
OscillationDuration=0.4
RotOscillation={(Pitch=(Amplitude=150.f,Frequency=100.f),
Yaw=(Amplitude=75.f,Frequency=80.f),
Roll=(Amplitude=150.f,Frequency=140.f))}
End Object
CriticalShake=Shake0