Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Can I attach particeattachment in script?
#3
(12-09-2024, 07:45 AM)josemendez Wrote: Hi!

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
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. 

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.
Reply


Messages In This Thread
RE: Can I attach particeattachment in script? - by gahyun11 - 12-09-2024, 09:20 AM