Obi Official Forum
Help I need to access the transform of a specific particle group - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Cloth (https://obi.virtualmethodstudio.com/forum/forum-2.html)
+--- Thread: Help I need to access the transform of a specific particle group (/thread-3488.html)



I need to access the transform of a specific particle group - KaanOzcelik - 16-06-2022

I need to access a particle group set in the blueprint in runtime, attach it to a transform created at the position of the groupĀ and move the transform to my desired position. How can I do it?


RE: I need to access the transform of a specific particle group - josemendez - 16-06-2022

(16-06-2022, 10:39 AM)KaanOzcelik Wrote: I need to access a particle group set in the blueprint in runtime, attach it to a transform created at the position of the groupĀ and move the transform to my desired position. How can I do it?

Sure, it's pretty simple:

Code:
// get the group:
var group = cloth.clothBlueprint.groups[groupIndex];

// create an attachment:
var attachment = cloth.AddComponent<ObiParticleAttachment>();
attachment.particleGroup = group;
attachment.target = yourTransform;

// move your transform:
yourTransform.position = newPos;



RE: I need to access the transform of a specific particle group - KaanOzcelik - 16-06-2022

(16-06-2022, 11:12 AM)josemendez Wrote: Sure, it's pretty simple:

Code:
// get the group:
var group = cloth.clothBlueprint.groups[groupIndex];

// create an attachment:
var attachment = cloth.AddComponent<ObiParticleAttachment>();
attachment.particleGroup = group;
attachment.target = yourTransform;

// move your transform:
yourTransform.position = newPos;

Thank you so much!