Before updating to Windows 10 you may need to return your Pro license. More information here

How to control World Particle Collider through script

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?

more ▼

asked Apr 04, 2011 at 12:21 AM

avatar image

46 6 4 10

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Add it to the actual particle effect, then you can enable/disable it...

Use get component


To get the component, and just .enable = false/true on which you want..

Should work =). Good luck!


function Update () {
        var test = gameObject.GetComponent("WorldParticleCollider");
more ▼

answered Apr 04, 2011 at 12:39 AM

avatar image

Justin Warner
6.8k 45 55 108

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, 2011 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, 2011 at 10:33 PM Justin Warner

Great! Thank you.

Apr 08, 2011 at 10:19 PM madeFromCode

gameObject.GetComponent("WorldParticleCollider") It doesn't work at all.

Jun 12, 2011 at 01:54 PM Yanger_xy
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



asked: Apr 04, 2011 at 12:21 AM

Seen: 3230 times

Last Updated: Jun 12, 2011 at 01:54 PM