Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Rope extension, vibration and collision
#24
(29-04-2025, 12:32 PM)0hsyn1 Wrote: If I want to switch to the new version, will I have a problem in my project?

It's hard to say, but most likely yes. There's many differences between versions 6 and 7, and your version is one of the oldest in the 6.X cycle so I'd avoid updating.

(29-04-2025, 12:32 PM)0hsyn1 Wrote: I can't add this code "public void OnRopeContactEnter(ObiSolver solver, ObiCollisionEventArgs collisionEvent)" to the "onContactEnter" event in ObiContactEventDispatcher

That doesn't make any sense whatsoever. In C#, the signature of the method you subscribe to an event must match the delegate.

The onContactEnter event in ObiContactEventDispatcher is triggered when a particle belonging to the actor first touches a collider. On the other hand, the method taking ObiCollisionEventArgs as argument is subscribed to the solver's OnCollision event, which returns all collisions that took place during the last simulation step. It's two completely different things, and I'm not sure which one you want. Would you mind clarifying what your goal is? You previously mentioned this:

(29-04-2025, 12:32 PM)0hsyn1 Wrote: I activate this code "ObiContactEventDispatcher", I assigned the "OnRopeContactEnter(ObiSolver solver, Oni.Contact contact)" function in another script to the onContactEnter event, so I can get the gameObjects that touch the rope.

This is not what ObiContactEventDispatcher's onContactEnter does: to get the gameObjects currently touching the rope, you should use solver.OnCollision and iterate trough all contacts as in the example script I shared. If you use ObiContactEventDispatcher, you'll get a single contact when the rope approaches an object, but it may or may not be the one currently in contact with it.

(29-04-2025, 12:32 PM)0hsyn1 Wrote: Also, my project is 2d, does this cause any problems in finding the "M" value?

Not at all. The engine works the same way both in 2D and 3D, 2D is just one spatial coordinate less.

(29-04-2025, 12:32 PM)0hsyn1 Wrote: I have another question, when I move the object to which I attached the rope, the rope does not stick to the object completely, why? I use Particle Attachment

Is it a dynamic or static attachment? If it's a dynamic one, how are you moving the object the rope is attached to?

kind regards
Reply


Messages In This Thread
RE: Rope extension, vibration and collision - by josemendez - 29-04-2025, 01:14 PM