docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class CinemachineImpulseDefinition

    Definition of an impulse signal that gets propagated to listeners.

    Here you provide a Raw Signal source, and define an envelope for time-scaling it to craft the complete Impulse signal shape. Also, you provide here parameters that define how the signal dissipates with spatial distance from the source location. Finally, you specify the Impulse Channel on which the signal will be sent.

    An API method is provided here to take these parameters, create an Impulse Event, and broadcast it on the channel.

    When creating a custom Impulse Source class, you will have an instance of this class as a field in your custom class. Be sure also to include the [CinemachineImpulseDefinition] attribute on the field, to get the right property drawer for it.

    Inheritance
    object
    CinemachineImpulseDefinition
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Cinemachine
    Assembly: Unity.Cinemachine.dll
    Syntax
    [Serializable]
    public class CinemachineImpulseDefinition

    Fields

    AmplitudeGain

    Legacy mode only: Gain to apply to the amplitudes defined in the signal source asset.

    Declaration
    [Tooltip("Legacy mode only: Gain to apply to the amplitudes defined in the signal source.  1 is normal.  Setting this to 0 completely mutes the signal.")]
    [FormerlySerializedAs("m_AmplitudeGain")]
    public float AmplitudeGain
    Field Value
    Type Description
    float

    CustomImpulseShape

    A user-defined impulse shape, used only if m_ImpulseShape is Custom. Defines the signal that will be generated. X axis must go from 0...1, and Y axis is the scale that will be applied to the impact velocity.

    Declaration
    [Tooltip("Defines the custom shape of the impact signal that will be generated.")]
    [FormerlySerializedAs("m_CustomImpulseShape")]
    public AnimationCurve CustomImpulseShape
    Field Value
    Type Description
    AnimationCurve

    DirectionMode

    Legacy mode only: How the signal direction behaves as the listener moves away from the origin.

    Declaration
    [Tooltip("Legacy mode only: How the signal direction behaves as the listener moves away from the origin.")]
    [FormerlySerializedAs("m_DirectionMode")]
    public CinemachineImpulseManager.ImpulseEvent.DirectionModes DirectionMode
    Field Value
    Type Description
    CinemachineImpulseManager.ImpulseEvent.DirectionModes

    DissipationDistance

    The signal will have no effect outside this radius surrounding the impact point.

    Declaration
    [Tooltip("The signal will have no effect outside this radius surrounding the impact point.")]
    [FormerlySerializedAs("m_DissipationDistance")]
    public float DissipationDistance
    Field Value
    Type Description
    float

    DissipationMode

    Legacy mode only: This defines how the signal will dissipate with distance beyond the impact radius.

    Declaration
    [Tooltip("Legacy mode only: This defines how the signal will dissipate with distance beyond the impact radius.")]
    [FormerlySerializedAs("m_DissipationMode")]
    public CinemachineImpulseManager.ImpulseEvent.DissipationModes DissipationMode
    Field Value
    Type Description
    CinemachineImpulseManager.ImpulseEvent.DissipationModes

    DissipationRate

    This defines how the widely signal will spread within the effect radius before dissipating with distance from the impact point

    Declaration
    [Tooltip("This defines how the widely signal will spread within the effect radius before dissipating with distance from the impact point")]
    [Range(0, 1)]
    [FormerlySerializedAs("m_DissipationRate")]
    public float DissipationRate
    Field Value
    Type Description
    float

    FrequencyGain

    Legacy mode only: Scale factor to apply to the time axis.

    Declaration
    [Tooltip("Legacy mode only: Scale factor to apply to the time axis.  1 is normal.  Larger magnitudes will make the signal progress more rapidly.")]
    [FormerlySerializedAs("m_FrequencyGain")]
    public float FrequencyGain
    Field Value
    Type Description
    float

    ImpactRadius

    Legacy mode only: The signal will have full amplitude in this radius surrounding the impact point.
    Beyond that it will dissipate with distance.

    Declaration
    [Header("Spatial Range")]
    [Tooltip("Legacy mode only: The signal will have full amplitude in this radius surrounding the impact point.  Beyond that it will dissipate with distance.")]
    [FormerlySerializedAs("m_ImpactRadius")]
    public float ImpactRadius
    Field Value
    Type Description
    float

    ImpulseChannel

    Impulse events generated here will appear on the channels included in the mask.

    Declaration
    [Tooltip("Impulse events generated here will appear on the channels included in the mask.")]
    [FormerlySerializedAs("m_ImpulseChannel")]
    public int ImpulseChannel
    Field Value
    Type Description
    int

    ImpulseDuration

    The time during which the impact signal will occur.
    The signal shape will be stretched to fill that time.

    Declaration
    [Tooltip("The time during which the impact signal will occur.  The signal shape will be stretched to fill that time.")]
    [FormerlySerializedAs("m_ImpulseDuration")]
    public float ImpulseDuration
    Field Value
    Type Description
    float

    ImpulseShape

    The shape of the impact signal.

    Declaration
    [Tooltip("Shape of the impact signal")]
    [FormerlySerializedAs("m_ImpulseShape")]
    public CinemachineImpulseDefinition.ImpulseShapes ImpulseShape
    Field Value
    Type Description
    CinemachineImpulseDefinition.ImpulseShapes

    ImpulseType

    How the impulse travels through space and time.

    Declaration
    [Tooltip("How the impulse travels through space and time.")]
    [FormerlySerializedAs("m_ImpulseType")]
    public CinemachineImpulseDefinition.ImpulseTypes ImpulseType
    Field Value
    Type Description
    CinemachineImpulseDefinition.ImpulseTypes

    PropagationSpeed

    The speed (m/s) at which the impulse propagates through space. High speeds allow listeners to react instantaneously, while slower speeds allow listeners in the scene to react as if to a wave spreading from the source.

    Declaration
    [Tooltip("The speed (m/s) at which the impulse propagates through space.  High speeds allow listeners to react instantaneously, while slower speeds allow listeners in the scene to react as if to a wave spreading from the source.")]
    [FormerlySerializedAs("m_PropagationSpeed")]
    public float PropagationSpeed
    Field Value
    Type Description
    float

    Randomize

    Legacy mode only: Randomize the signal start time

    Declaration
    [Tooltip("Legacy mode only: Randomize the signal start time")]
    [FormerlySerializedAs("m_Randomize")]
    public bool Randomize
    Field Value
    Type Description
    bool

    RawSignal

    Legacy mode only: Defines the signal that will be generated.

    Declaration
    [Header("Signal Shape")]
    [Tooltip("Legacy mode only: Defines the signal that will be generated.")]
    [CinemachineEmbeddedAssetProperty(true)]
    [FormerlySerializedAs("m_RawSignal")]
    public SignalSourceAsset RawSignal
    Field Value
    Type Description
    SignalSourceAsset

    RepeatMode

    Legacy mode only: How to fit the signal into the envelope time

    Declaration
    [Tooltip("Legacy mode only: How to fit the signal into the envelope time")]
    [FormerlySerializedAs("m_RepeatMode")]
    public CinemachineImpulseDefinition.RepeatModes RepeatMode
    Field Value
    Type Description
    CinemachineImpulseDefinition.RepeatModes

    TimeEnvelope

    Legacy mode only: This defines the time-envelope of the signal.
    The raw signal will be time-scaled to fit in the envelope.

    Declaration
    [Tooltip("Legacy mode only: This defines the time-envelope of the signal.  The raw signal will be time-scaled to fit in the envelope.")]
    [FormerlySerializedAs("m_TimeEnvelope")]
    public CinemachineImpulseManager.EnvelopeDefinition TimeEnvelope
    Field Value
    Type Description
    CinemachineImpulseManager.EnvelopeDefinition

    Methods

    CreateAndReturnEvent(Vector3, Vector3)

    Generate an impulse event at a location in space, and broadcast it on the appropriate impulse channel

    Declaration
    public CinemachineImpulseManager.ImpulseEvent CreateAndReturnEvent(Vector3 position, Vector3 velocity)
    Parameters
    Type Name Description
    Vector3 position

    Event originates at this position in world space

    Vector3 velocity

    This direction is considered to be "down" for the purposes of the event signal, and the magnitude of the signal will be scaled according to the length of this vector

    Returns
    Type Description
    CinemachineImpulseManager.ImpulseEvent

    The newly-created impulse event. This can be used to dynamically adjust the event settings while the event is active. Note that this event object may be recycled for future events, so the pointer should not be retained for too long.

    CreateEvent(Vector3, Vector3)

    Generate an impulse event at a location in space, and broadcast it on the appropriate impulse channel

    Declaration
    public void CreateEvent(Vector3 position, Vector3 velocity)
    Parameters
    Type Name Description
    Vector3 position

    Event originates at this position in world space

    Vector3 velocity

    This direction is considered to be "down" for the purposes of the event signal, and the magnitude of the signal will be scaled according to the length of this vector

    OnValidate()

    Call this from your behaviour's OnValidate to validate the fields here

    Declaration
    public void OnValidate()
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)