Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How can I control Impulse using Timeline track?

Discussion in 'Cinemachine' started by gsylvain, Sep 14, 2020.

  1. gsylvain

    gsylvain

    Joined:
    Aug 6, 2014
    Posts:
    100
    [Cinemachine 2.6, Timeline 1.4.1]

    We are searching how to add a timeline track that would allow an artist to precisely set the begin and end frame of a shake, with a shake profile as parameter.

    *We can't use physic based impulses.

    Do you know how? Thank you!
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
  3. gsylvain

    gsylvain

    Joined:
    Aug 6, 2014
    Posts:
    100
    I knew about using a Signal to trigger the shake at the right time. I don't like this solution very much because it doesn't allow to properly set the begin and ending frame, nor the shake profile to use.
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    The duration of the shake is defined by the impulse source. If you're wanting a continuous shake, like a rumble vibration, then you'll need to write a small piece of code to generate a continuous impulse consisting of a series of small overlapping impulses, which you can start/stop using timeline signals.

    Here is an example of that: https://forum.unity.com/threads/cre...e-that-can-turned-on-off.891304/#post-5872768

    Note: in the emitter script provided in the thread, you can add Start/Stop methods to call from timeline.
     
  5. gsylvain

    gsylvain

    Joined:
    Aug 6, 2014
    Posts:
    100
    Thank you for your quick answers! This seems like a nice compromise, I'll definitely experiment with that.
    Have a nice day! :)
     
    Gregoryl likes this.