|
The problem is this: I have a scene of a bunch of spheres bouncing around like particles in a contained area. Via TUIO, I have a point that appears on the scene and repels particles, but only if they come within a close radius. This all works fine, except that when I put a TUIO point on the scene, the particles that get repelled by the TUIO point never stop being affected by the repulsion, no matter how far away they disperse, until the TUIO point disappears from the scene completely. I have the repulsion script being called AFTER a check to see whether the particle is in range of the TUIO repulsor. If there is no TUIO repulsor in range, it returns null and so should not be repelling anything. Yet I find when looking in scene view, all the particles end up bouncing repeatedly against the walls, stuck there until the TUIO repulsor disappears. I'd appreciate any help. Here's the code. Thanks! using System.Collections; public class FollowTUIO_RGBParticles : MonoBehaviour { void applyForce(GameObject repulsor) { if(repulsor == null) { applyConstantRandomForce(); } else { void applyConstantRandomForce() { }
(comments are locked)
|
|
You could fix that a lot of ways, for example have note that here I'm returning the temp variable
(comments are locked)
|
|
Ohhh I totally see it now! I've been looking at code for a liiiittle too long these last few days :p Thank you for pointing it out
(comments are locked)
|
