Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Assigning Obi Handle in Editor
#4
(05-07-2019, 01:23 PM)Necka Wrote: Hello,

thank you very much for the detailled answer,

I was not speaking about runtime but in editor - I was expecting to see a line somewhere on one of the Rope components when selecting the particles pinned to a handle "This particle is pinned to that Handle" but that doesn't seem to appear in any inspector.


For context: My player have some sort of tool weapon that has a rope (looking like a Laser) where the end of the ropeĀ is attached to the mouse position. I'm having a hard time as when the player equip the weapon, the rope goes crazy for a few frames (despite being super rigid and the distance constraint quite high). So I'm trying now to have the reel-in and out working but I need to get the last particles for the pin to work in that case...

Hi,

In editor, handles are created from the particle editor (ObiParticleActorEditor.cs, "DrawFixControls" method). It basically does the same thing I posted previously: create a new GameObject, add a ObiHandle, and add the selected particles to it.

Quote:I think I'll go with a runtime solution then, it's more flexible. But I'm again very sorry for this, from the documentation I always find the way of selecting the first particles but in my case I need a handle to be attached at the end of the rope. Is there an easy way of selecting the last index of the particles?

And bonus question: I believe this won't work if I expend/retract the rope as the last particle will always be different, right?

When tearing/changing the length of a rope, particle ordering changes, however constraint ordering does not. There's several methods in the rope actor that let you get info about structural constraints (which for ropes are distance constraints, and for rods are stretch/shear constraints), and the particles they're affecting. So if you grab the second particle of the last constraint, that would be the last particle in the rope.

Anyway, this is not at all necessary for what you want to do, I think. ObiCursor can change the length of a rope by adding/removing rope from any point in the rope, in both directions. So simply place the cursor before the end of the rope. If the last particle is part of a handle, it will be preserved when changing rope length. See:
http://obi.virtualmethodstudio.com/tutor...ursor.html
Reply


Messages In This Thread
Assigning Obi Handle in Editor - by Necka - 04-07-2019, 10:25 PM
RE: Assigning Obi Handle in Editor - by Necka - 05-07-2019, 01:23 PM
RE: Assigning Obi Handle in Editor - by josemendez - 05-07-2019, 02:17 PM