- Home /
Setting Particle Collision via C#
using this: https://docs.unity3d.com/ScriptReference/ParticleSystem.CollisionModule-collidesWith.html I can only assume it's possible, but it will not work.
I write:
var c = ps.collision;
c.collidesWith = 1 << 15;
and I get this error:
NullReferenceException: Object reference not set to an instance of an object
PowerCollision.SetTarget (Int32 i)
I'm only doing this because unity's particle stopping system is suspiciously broken in the first place. These anomalies are setting me back big time and I would hugely appreciate any help.
Answer by Tekksin · Sep 24, 2018 at 06:44 PM
I ended up avoiding the collision system for unity's particles all together. I could not get them to work and found myself better off using sphere collider triggers to do my projectile interaction. If anybody has an answer for this, please offer it, but it is no longer pressing, for me.
Your answer
Follow this Question
Related Questions
Emit Random Particles? 2 Answers
Unity 2D Particle System Interaction. 0 Answers
Glowing Particle 3 Answers
Finding Particle Information Upon Collision 2 Answers
How to keep particles moving past an obstacle after they have collided with it? 3 Answers