In game parenting of Obi Particle Attachment - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html) +--- Thread: In game parenting of Obi Particle Attachment (/thread-3893.html) Pages:
1
2
|
In game parenting of Obi Particle Attachment - Holty - 27-05-2023 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. 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. RE: In game parenting of Obi Particle Attachment - josemendez - 27-05-2023 (27-05-2023, 09:15 AM)Holty Wrote: Hi there, 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 RE: In game parenting of Obi Particle Attachment - Holty - 28-05-2023 (27-05-2023, 01:50 PM)josemendez Wrote: Hi! Yes good point! Sorry I didn't mention what the problem is The parenting is not happening. I have Debug.log messages in the if statement confirming they are colliding but no parenting takes place. Thanks RE: In game parenting of Obi Particle Attachment - josemendez - 28-05-2023 (28-05-2023, 01:02 PM)Holty Wrote: Yes good point! Sorry I didn't mention what the problem is 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? RE: In game parenting of Obi Particle Attachment - Holty - 29-05-2023 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! RE: In game parenting of Obi Particle Attachment - josemendez - 29-05-2023 (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. 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 RE: In game parenting of Obi Particle Attachment - Holty - 05-06-2023 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 RE: In game parenting of Obi Particle Attachment - josemendez - 05-06-2023 (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! 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, RE: In game parenting of Obi Particle Attachment - Holty - 06-06-2023 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 RE: In game parenting of Obi Particle Attachment - josemendez - 06-06-2023 (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: Hi, Could you share the script you’re using to make the rigidbody kinematic upon impact? |