|
Is there a way to add a world particle collider to a particle system through script. AddComponent(???); If there's not a way to add it at runtime is there a way to enable/disable it?
(comments are locked)
|
|
Add it to the actual particle effect, then you can enable/disable it... Use get component http://unity3d.com/support/documentation/ScriptReference/GameObject.html To get the component, and just .enable = false/true on which you want.. Should work =). Good luck! Code: Preferably I'd like to create it in script with addComponent but I went ahead and added it to the prefab to try and control it that way. I can't seem to find out how to enable/disable it though. If I try to getComponent(Collider) it says there's not a collider attached. There's not an option, that I can find, for getting a WorldParticleCollider. Do you know the correct syntax for this?
Apr 04 '11 at 09:15 PM
madeFromCode
Edited and it works... So, that test is a gameobject, so now you can do .enable = false/true...
Apr 04 '11 at 10:33 PM
Justin Warner
Great! Thank you.
Apr 08 '11 at 10:19 PM
madeFromCode
gameObject.GetComponent("WorldParticleCollider") It doesn't work at all.
Jun 12 '11 at 01:54 PM
Yanger_xy
(comments are locked)
|
