unreal.CameraShake

class unreal.CameraShake(outer=None, name='None')

Bases: unreal.Object

A CameraShake is an asset that defines how to shake the camera in a particular way. CameraShakes can be authored as either oscillating shakes, animated shakes, or both.

An oscillating shake will sinusoidally vibrate various camera parameters over time. Each location and rotation axis can be oscillated independently with different parameters to create complex and random-feeling shakes. These are easier to author and tweak, but can still feel mechanical and are limited to vibration-style shakes, such as earthquakes.

Animated shakes play keyframed camera animations. These can take more effort to author, but enable more natural-feeling results and things like directional shakes. For instance, you can have an explosion to the camera’s right push it primarily to the left.

C++ Source:

  • Module: Engine
  • File: CameraShake.h

Editor Properties: (see get_editor_property/set_editor_property)

  • anim (CameraAnim): [Read-Write] Source camera animation to play. Can be null.
  • anim_blend_in_time (float): [Read-Write] Linear blend-in time.
  • anim_blend_out_time (float): [Read-Write] Linear blend-out time.
  • anim_inst (CameraAnimInst): [Read-Write] The playing instance of the CameraAnim-based shake, if any.
  • anim_play_rate (float): [Read-Write] Scalar defining how fast to play the anim.
  • anim_scale (float): [Read-Write] Scalar defining how “intense” to play the anim.
  • camera_owner (PlayerCameraManager): [Read-Write] Camera Owner
  • fov_oscillation (FOscillator): [Read-Write] FOV oscillation
  • loc_oscillation (VOscillator): [Read-Write] Positional oscillation
  • oscillation_blend_in_time (float): [Read-Write] Duration of the blend-in, where the oscillation scales from 0 to 1.
  • oscillation_blend_out_time (float): [Read-Write] Duration of the blend-out, where the oscillation scales from 1 to 0.
  • oscillation_duration (float): [Read-Write] Duration in seconds of current screen shake. Less than 0 means indefinite, 0 means no oscillation.
  • oscillator_time_remaining (float): [Read-Write] Time remaining for oscillation shakes. Less than 0.f means shake infinitely.
  • random_anim_segment (bool): [Read-Write] If true, play a random snippet of the animation of length Duration. Implies bLoop and bRandomStartTime = true for the CameraAnim. If false, play the full anim once, non-looped. Useful for getting variety out of a single looped CameraAnim asset.
  • random_anim_segment_duration (float): [Read-Write] When bRandomAnimSegment is true, this defines how long the anim should play.
  • rot_oscillation (ROscillator): [Read-Write] Rotational oscillation
  • shake_scale (float): [Read-Write] Overall intensity scale for this shake instance.
  • single_instance (bool): [Read-Write] If true to only allow a single instance of this shake class to play at any given time. Subsequent attempts to play this shake will simply restart the timer.
anim_inst

(CameraAnimInst) – [Read-Only] The playing instance of the CameraAnim-based shake, if any.

blueprint_update_camera_shake(delta_time, alpha, pov) → MinimalViewInfo

Called every tick to let the shake modify the point of view

Parameters:
Returns:

modified_pov (MinimalViewInfo):

Return type:

MinimalViewInfo

camera_owner

(PlayerCameraManager) – [Read-Only] Camera Owner

fov_oscillation

(FOscillator) – [Read-Write] FOV oscillation

loc_oscillation

(VOscillator) – [Read-Write] Positional oscillation

oscillator_time_remaining

(float) – [Read-Only] Time remaining for oscillation shakes. Less than 0.f means shake infinitely.

receive_is_finished() → bool

Called to allow a shake to decide when it’s finished playing.

Returns:
Return type:bool
receive_play_shake(scale) → None

Called when the shake starts playing

Parameters:scale (float) –
receive_stop_shake(immediately) → None

Called when the shake is explicitly stopped.

Parameters:immediately (bool) –
rot_oscillation

(ROscillator) – [Read-Write] Rotational oscillation

shake_scale

(float) – [Read-Write] Overall intensity scale for this shake instance.