Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Setting ObiParticleAttachment ParticleGroup via script
#4
Dedo arriba 
(11-01-2020, 03:22 PM)josemendez Wrote: Hi Bob,

Particle groups are stored in the "groups" list of the blueprint. So simply do:

Code:
attachment.particleGroup = blueprint.groups[index];

(If you don't already have a reference to the actor's blueprint, you can get it like this):
Code:
var blueprint = attachment.actor.blueprint;

That's it.

You can see an example in ObiParticleAttachmentEditor.cs, which is the script for the particle group inspector.
There you'll see we use a GenericMenu to show a dropdown menu listing all the particle groups in the blueprint (by name). When the user picks one, the OnParticleGroupSelected() method is called (passing the group as a parameter). This method then assigns the particle group to the attachment's particleGroup property.

Thanks, Jose! Much appreciated Sonrisa
Reply


Messages In This Thread
RE: Setting ObiParticleAttachment ParticleGroup via script - by Bobsalot - 11-01-2020, 04:37 PM