How do I do a simple shake over a specific duration?

Spent the last hour trying to figure out how to use the impulse listener to generate a long steady shake like the 6D shake where I control the duration, but I cannot find any references on how to achieve this through code.

I just want to tell it to “Activate 6D noise for X seconds”. I know how to activate it via the inspector, but not via code.

Heyyoo :slight_smile:
Which version of cinemachine are you using?

2.9.7 :slight_smile:

Check this :slight_smile:

But your latest communications have said we should use the impulse listener, now you link a video that doesnt use it?

You can also do it with Impulse.

There is no specific feature for continuous impulse, but it’s possible to achieve it by continuously emitting short overlapping impulses. Example here: https://forum.unity.com/threads/cre…e-that-can-turned-on-off.891304/#post-5872768

Okay, but youve made it sound like anything not using impulse is legacy in old communications. So is it fine to use noise as in the video?

This is such a simple thing to do with a custom camera, so just considering skipping cinemachine tbh.

Is there no way to control impulse duration?

The script in the linked thread shows how to turn a continuous shake on and off by toggling the Active bool member variable. You can augment it by adding methods that take a duration param, or by setting a specific duration. You can have multiple such emitters each with their own duration. Results will be cumulative. How you want to implement it is up to you.

As for using the noise as in the video, that’s fine but it will mean that you can’t have other noise (such as hand-held camera shake) on that vcam. The advantage of Impulse is that it won’t interfere with other camera noise.

1 Like