Search Unity

Howto Shake Camera With Each Dinosaur Step?

Discussion in 'Scripting' started by the_Bad_Brad, Oct 21, 2017.

  1. the_Bad_Brad

    the_Bad_Brad

    Joined:
    Nov 2, 2014
    Posts:
    278
    I was wondering how do I make the main camera shake with each step a t-rex dinosaur take.
     
  2. DonLoquacious

    DonLoquacious

    Joined:
    Feb 24, 2013
    Posts:
    1,667
    Absolute ton of tutorials and scripts on shaking the camera- just use Google to find them ("Unity camera shake"). Trigger the effect by setting up an "event" in the T-Rex walking animation data (but this would apply to anything using the same animation), or add a StateMachineBehaviour to the animation set in the Animator, and trigger it from there. If you need help with the timing, just search for ways to make proper footfall sound effects- the logic is absolutely identical.

    Cinemachine is also a really good bet if you're using 2017.1+ since it has a ton of camera controls built in, camera shaking being one of them.