Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

how can i creat soap bubble effects.

Discussion in 'General Graphics' started by sharpg, Sep 21, 2015.

  1. sharpg

    sharpg

    Joined:
    Mar 10, 2015
    Posts:
    150
    Dear all i am working on a small 2d android game.I want if i apply soap to my object then there should create bubbles on other object which disappear automatically after a certain time.Please help me how can i create such kind of effects?
    Thanks.
     
  2. Stankiem

    Stankiem

    Joined:
    Dec 4, 2013
    Posts:
    115
    Might be possible simpler with a particle emitter? Can search for that maybe? Otherwise the below is how I would do it offhand:

    Look into the following topics:
    Prefabs
    Instantiate
    Destroy
    Time.Time

    You will want to create a prefab of a bubble sprite, attach a script that it that counts down every Update() using Time.Time. When your timer reaches 0 Destroy the gameobject. From your object that will spawn the bubbles, instantiate the bubble prefabs at the appropriate time.

    Hope this helps!
     
    theANMATOR2b likes this.