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

Shuriken Particle System issue

Discussion in 'Scripting' started by Elder_Crivelari, Mar 14, 2015.

  1. Elder_Crivelari

    Elder_Crivelari

    Joined:
    Nov 9, 2013
    Posts:
    7
    Hi there guys! Im new to the forums, so if my question is in the wrong place, please put it in the right place!

    Well, i have a really weird problem, i don't seem to understand the collision on particles in unity.
    i'm making an starfox like game, and the level is an asteroid field, so i made the asteroids changing the renderer on shuriken, and done the things that i need. So the asteroids are all with 0 velocity, so they stand in place too. But the problem is, that even using the "OnParticleCollision" function, i can't get any collision on those asteroids...

    I've changed the collision to world, tried everything but it seems that t doesn't work. Even there, if i create a simple particle system, and put a box to collide, at the editor it works perfectly, but when i hit the play button, it wont work too =/

    Using the particle system to create the asteroids is really better than ever, but i need to make the asteroids collide, and i cant figure out how i make things collide with them!
    i'm not sure if i'm clear enougth here, because i have a baaad english, and i'm scripting in c#, even the code below won't print anything to the console!

    void OnParticleCollision(GameObject collisor) {
    print(collisor.gameObject.tag);
    }

    All the tutorials on google, really... suck really bad... they only create a simple particle system that collides with a plane and nothing more...
    Please, save my life! Haha
     
  2. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    As far as I understand it, your asteroids are particles and they are not moving. In this situation it seems you want to detect collisions of other objects with the asteroids. From what I can see, your expectations don't match with what actually exists in Shuriken.
    The collision of particles works different than other collisions. It works based on raycasts. When the position of a particle changes, a raycast is performed from the old to the new position in order to find collisions. That means, the shape of the particle is approximated to a point and as such not accurate at all.

    Some useful information can be found here:
    http://blogs.unity3d.com/2012/11/18/shuriken-world-particle-collision/
     
    Elder_Crivelari likes this.
  3. Elder_Crivelari

    Elder_Crivelari

    Joined:
    Nov 9, 2013
    Posts:
    7
    So , now i understand ^^ Thanks a lot!
     
  4. tawdry

    tawdry

    Joined:
    Sep 3, 2014
    Posts:
    1,356