Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Suggestion / Idea  [Workaround] Setting target at runtime for ObiParticleAttachment
#3
Hi Guys,

I'm working on ObiParticleAttachment at runtime too. After made some tries I spotted something weird.
I procedurally generate a rope and its blueprint, then I add an ObiParticleAttachement on my rope and assign the target and the particle group by script.

In the ObiParticleAttachment component generated, everything seems good but my rope still not attached to my target.
So I looked for the reason, the issue seems be when I set my particleGroup to the attachment by      
  
Code:
attachment.particleGroup = rope.blueprint.groups[0];

In the particlegroup set accessor inside ObiParticleAttachment.cs the new value is assigned after the Bind method, so the script doesn't go through. 
I've fixed that simply by set the value before the bind()

Code:
           set
           {
               if (value != m_ParticleGroup)
               {
                   Disable(m_AttachmentType);
                   m_ParticleGroup = value;
                   Bind();
                   UpdateEnabledState();
               }
           }

However I didn't try if this correction could cause some issues elsewhere. For my case, it's working now !
Reply


Messages In This Thread
RE: [Workaround] Setting target at runtime for ObiParticleAttachment - by Chess - 27-03-2020, 06:41 PM