Search Unity

Quicksand Sinking Effect

Discussion in 'Physics' started by usmanmohl, Dec 28, 2015.

  1. usmanmohl

    usmanmohl

    Joined:
    Dec 28, 2015
    Posts:
    2
    Hi everyone!

    I have been creating a 2D Platformer and have animations for quicksand but I am stuck on how to approach setting up the sinking effect. Does this get applied to the Collider? How would I write the code?

    Thanks!
     
  2. tawdry

    tawdry

    Joined:
    Sep 3, 2014
    Posts:
    1,357
    What animations are they for the quicksand itself or for the character?
     
  3. usmanmohl

    usmanmohl

    Joined:
    Dec 28, 2015
    Posts:
    2
    There are two animations, the first is the quicksand itself moving from left to right (2D game) and the second is the character waving his hands in the air as he sinks. I created a box collider 2D and had it sit on the top of the quicksand animation so that when the character touches it, he starts to fall. Then I created this long collider and named it deathFall so that when the quicksand collider touches it, it plays the reset script that I created to reset the level. I just put the character behind the quicksand to make it look like hes sinking. Is there a more efficient method? Thanks!