29-07-2020, 03:06 PM
Hi, I'd be interested in removing or adding particle attachments from ropes at runtime. Is this possible? Or could this be done by adding a rigidbody and a normal Unity joint to use as a proxy?
Remove / add particle attachment at runtime?
|
29-07-2020, 03:06 PM
Hi, I'd be interested in removing or adding particle attachments from ropes at runtime. Is this possible? Or could this be done by adding a rigidbody and a normal Unity joint to use as a proxy?
31-07-2020, 12:23 PM
(This post was last modified: 31-07-2020, 12:24 PM by josemendez.)
(29-07-2020, 03:06 PM)Lockpickle Wrote: Hi, I'd be interested in removing or adding particle attachments from ropes at runtime. Is this possible? Or could this be done by adding a rigidbody and a normal Unity joint to use as a proxy? Sure, simply add a ObiParticleAttachment component as you would with any other component, and set its target and particle group attributes to whatever you need. To remove it simply destroy the component. let me know if you need help with this.
31-07-2020, 04:05 PM
(31-07-2020, 12:23 PM)josemendez Wrote: Sure, simply add a ObiParticleAttachment component as you would with any other component, and set its target and particle group attributes to whatever you need. To remove it simply destroy the component. Thanks! This didn't seem to work when I tried it, but maybe I had something wrong. I did get it working eventually using a proxy object. But also, what if I want to attach something to a part of the rope other than a control point, can I somehow add a particle group dynamically?
31-07-2020, 04:14 PM
(This post was last modified: 31-07-2020, 04:14 PM by josemendez.)
(31-07-2020, 04:05 PM)Lockpickle Wrote: Thanks! This didn't seem to work when I tried it, but maybe I had something wrong. I did get it working eventually using a proxy object. But also, what if I want to attach something to a part of the rope other than a control point, can I somehow add a particle group dynamically? Yes, a particle group is simply a scriptable object that contains a list of particle indices. You can create one (using CreateInstance, the usual way for scriptable objects) and populate its particleIndices list with the indices of the particles you want to attach. Then, assign it to the attachment. |
« Next Oldest | Next Newest »
|