Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Adding points to Obi Rope in rune time
#5
(16-06-2020, 01:49 PM)davidsedrakyan Wrote: Thanks for the answer, as I understand I need to reycast when the user clicks on the rope, and get the exact point of the particle, but I also need the point to be added on the particle blueprint right? I can't understand how to add a point to the particle blueprint and how to get point-particle of that point that user clicked.

Hi there,

There's a class already that raycasts against all particles in a solver and returns the one that was hit: ObiParticlePicker. You can subscribe to any of its events: they receive a ParticlePickEventArgs struct as parameter, that contains both the particle index and its world space position.

Once you've got the index of the particle, you simply create a particle group that contains this index, and pass it to the attachment's particleGroup property. That's all.

I don't understand what you mean when you say "add points to the blueprint". You're referring to path control points, particles, or particle groups? By default, when you create a new control point in the editor, a particle group (that contains the index of the particle at that control point) is added to the blueprint for convenience. However particle groups can exist on their own (they're scriptable objects) there's no need to add new ones to the blueprint if you're creating/using them at runtime.
Reply


Messages In This Thread
RE: Adding points to Obi Rope in rune time - by josemendez - 16-06-2020, 02:34 PM