(12-09-2024, 07:45 AM)josemendez Wrote: Hi!Hello! thank you for your reply. I understood the part that you saying the particle attachment component wont work cause there's no blueprint particle group at all. But I cannot understand why there's a difference between adding particle attachment into cloth gameobject through inspector, and just cloth gameobject.
Your code doesn't do anything, since it's incomplete: you're not providing a particle group for the attachment to attach. As a result, the attachment doesn't know which part(s) of the cloth it should act upon.
See the manual's page on scripting attachments:
http://obi.virtualmethodstudio.com/manua...ments.html
As a side note, calling GetComponent() every time you want to access a component in Unity is quite expensive. Since you're adding the component yourself, a much better option is to just store it in a variable when you add it.
kind regards
And about the Getcomponent() dont worry, we just call get component only when we enable cloth. and that happens only few times happends in whole playtime.