Announcement

Collapse
No announcement yet.

Camera location updating?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Camera location updating?

    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?

    #2
    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
    Code:
        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...
    Code:
    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:
    Code:
        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
    Check out Himeko Sutori, the upcoming tactical RPG where you control armies of over 100 unique characters.

    Comment

    Working...
    X