Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
In game parenting of Obi Particle Attachment
#1
Hi there,

I have searched for a solution to this and found a few good hits but nothing seems to be working for me for some reason.  Triste

I'm using Obi Rope in a VR setting as part of a ladder fall arrest system. I basically just need something whereby when the player grabs the end Obi Particle attachment of the rope and attaches it to a fall delay device which is a child of the VR player avatar. I have the grabbing bit working fine. The player can interact with the rope end no problem. It's the parenting of the obi particle attachment end to the fall delay device that's just not playing ball. There are colliders on both the delay device (parent) and the Obi Participle End (child) and obviously a rigid body on the particle end. I'm using fairly basic code with parent and child objects set in the inspector.

private void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject == parentObject)
        {
            childObject.transform.SetParent(parentObject.transform, true);
        }


Hope someone can help. Many thanks.
Reply
#2
(27-05-2023, 09:15 AM)Holty Wrote: Hi there,

I have searched for a solution to this and found a few good hits but nothing seems to be working for me for some reason.  Triste

I'm using Obi Rope in a VR setting as part of a ladder fall arrest system. I basically just need something whereby when the player grabs the end Obi Particle attachment of the rope and attaches it to a fall delay device which is a child of the VR player avatar. I have the grabbing bit working fine. The player can interact with the rope end no problem. It's the parenting of the obi particle attachment end to the fall delay device that's just not playing ball. There are colliders on both the delay device (parent) and the Obi Participle End (child) and obviously a rigid body on the particle end. I'm using fairly basic code with parent and child objects set in the inspector.

private void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject == parentObject)
        {
            childObject.transform.SetParent(parentObject.transform, true);
        }


Hope someone can help. Many thanks.

Hi!

Attachments attach Obi particles to any regular transform. There isn’t anything that makes that transform special or different to any other, parenting should work the usual way.

You don’t specify what the issue with parenting is: works in an unexpected way (and if so, how?)  doesn’t work at all, works with “normal” transforms but not with transforms attached to a rope…?

Kind regards
Reply
#3
(27-05-2023, 01:50 PM)josemendez Wrote: Hi!

Attachments attach Obi particles to any regular transform. There isn’t anything that makes that transform special or different to any other, parenting should work the usual way.

You don’t specify what the issue with parenting is: works in an unexpected way (and if so, how?)  doesn’t work at all, works with “normal” transforms but not with transforms attached to a rope…?

Kind regards

Yes good point! Sorry I didn't mention what the problem is  Sonrisa

The parenting is not happening. I have Debug.log messages in the if statement confirming they are colliding but no parenting takes place.

Thanks
Reply
#4
(28-05-2023, 01:02 PM)Holty Wrote: Yes good point! Sorry I didn't mention what the problem is  Sonrisa

The parenting is not happening. I have Debug.log messages in the if statement confirming they are colliding but no parenting takes place.

Thanks

Hi!

That's really weird, Obi shouldn't change the behavior of parenting at all. They're completely different systems, independent of each other. Have you tested whether parenting is working when the rope is not attached?
Reply
#5
OK got some progress. There is parenting of sorts but is an approximation between the two objects and the rope / particle attachment bounces around and is not 'locked' in place to the parent and it's position. 

Like an unruly child!  Gran sonrisa
Reply
#6
(29-05-2023, 10:26 AM)Holty Wrote: OK got some progress. There is parenting of sorts but is an approximation between the two objects and the rope / particle attachment bounces around and is not 'locked' in place to the parent and it's position. 

Like an unruly child!  Gran sonrisa

Hi,

I don't think I can picture this in my mind, never heard of anything similar. Transforms aren't simulated (unless they have a rigidbody component) so not sure how it can bounce around. Could you post a video or share a repro scene?

kind regards
Reply
#7
Hi there. Sorry was away from project file for awhile. Here is a video showing what's happening. Red ball is a stand in for the attachment for the player avatar and is a child of the player VR avatar. Aiming to have the particle end (green ball) to be a child of the red ball but without the wandering and random movements. Thanks!

Obi Rope parenting issue
Reply
#8
(05-06-2023, 08:35 AM)Holty Wrote: Hi there. Sorry was away from project file for awhile. Here is a video showing what's happening. Red ball is a stand in for the attachment for the player avatar and is a child of the player VR avatar. Aiming to have the particle end (green ball) to be a child of the red ball but without the wandering and random movements. Thanks!

Obi Rope parenting issue

Hi!

The video shows parenting working as intended: since the green ball is a rigidbody, once parented to the red ball it will be simulated in the red ball's local space.

I get the feeling that you're confused about what parenting does. Parenting a transform to another one just makes its position/rotation/scale be based off its parent's. It does not however affect the simulation of rigidbodies in any way -they'll still be moving around- in particular it won't make them kinematic which is what I believe you're looking for based on your description:

Quote:it's not 'locked' in place to the parent and it's position.

This 'locking' an object is place is not achieved by parenting transforms, but by making rigidbodies kinematic. If you make the green ball rigidbody kinematic upon impact and parent it to the red ball, it will stop reacting to forces and and move together with the red ball, essentially locking both together.

Note that none of this has anything to do with Obi, it's standard Unity behavior.

kind regards,
Reply
#9
OK cool I understand but this is what happens when the green ball rigid body becomes 'kinematic' on contact. Can post code and rope settings if would help:

https://vimeo.com/833681090/2af1975567?share=copy
Reply
#10
(06-06-2023, 03:03 PM)Holty Wrote: OK cool I understand but this is what happens when the green ball rigid body becomes 'kinematic' on contact. Can post code and rope settings if would help:

https://vimeo.com/833681090/2af1975567?share=copy

Hi,

Could you share the script you’re using to make the rigidbody kinematic upon impact?
Reply