Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Cinemachine Shake con 2D Camera

Discussion in 'Cinemachine' started by DavidAvenue, Sep 10, 2018.

  1. DavidAvenue


    Dec 27, 2016

    Is ImpulseListener the best way to achieve 2D shakes? Wanted to achieve things like recoils and 'quakes', but haven't been able to achieve so pretty well, so I guess my other question would be: what's the best resource to learn how to use impulse listeners?

    I'm gonna be needing to do the shake calls through code as well.

    Any help is greatly appreciated.
  2. Gregoryl


    Unity Technologies

    Dec 22, 2016
    For a 2D shake, just define a signal which is static in the Z direction. You can take one of the sample signals, say the 6D shake, clone it, and delete the Z axis channels.

    Look at the Impulse scene in the Cinemachine Examples. This is a good place to see how Impulse is used.

    You can generate impulses from code very easily. CinemachineImpulseSource is a good starting point. It's very simple, and you can see in there exactly how the impulse is generated. Just do the same thing from your own scripts. CinemachineCollisionImpulseSource is an example of a script that inherits from CinemachineImpulseSource, and generates impulses when it detects interaction with a Collider. Your own script can generate impulses in response to whatever you like.