Obi Official Forum

Full Version: Rope Reference from ObiParticlePicker
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, i am using obi particle picker component to move my rope with mouse cursors, how can i get the picked rope reference from that component to use events like OnParticleDragged,OnParticleHeld ?
(22-09-2023, 09:46 AM)littleanchovy Wrote: [ -> ]Hello, i am using obi particle picker component to move my rope with mouse cursors, how can i get the picked rope reference from that component to use events like OnParticleDragged,OnParticleHeld ?

Given the index of the particle in the solver (which is passed to OnParticleDragged/Held), you can do:

Code:
ObiSolver.ParticleInActor pa = solver.particleToActor[particleIndex];
var rope = pa.actor as ObiRope;

See: http://obi.virtualmethodstudio.com/manua...icles.html
(22-09-2023, 09:46 AM)littleanchovy Wrote: [ -> ]Hello, i am using obi particle picker component to move my rope with mouse cursors, how can i get the picked rope reference from that component to use events like OnParticleDragged,OnParticleHeld ?
thank you !