Help Connect dynamic rope attachment to another rigidbody object - 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: Help Connect dynamic rope attachment to another rigidbody object (/thread-3238.html) |
Connect dynamic rope attachment to another rigidbody object - ghawstie - 17-12-2021 I am trying to make a first person grappling hook mechanic using obi rope. The rope is attached dynamically to an object which is the fire source, which is the child of the camera which I placed inside of the player object (which has a rigidbody). On the other end it is statically attached. Right now I managed to make it work almost as it should: I added a fixed joint to the fire source, which links it to the camera; the camera also has a fixed joint which links it to the player. The grappling itself is working, the issue is that jumping and ground movement now feel very clunky because of the player object's two childs (camera and fire source) which now have rigidbodies... How can I improve this? Or are there better ways of doing this overall? Here's a link to a google drive folder with some screenshots and a video: https://drive.google.com/drive/folders/1hocMi2rCmbZCYWDFL8idukv3560YheXL?usp=sharing RE: Connect dynamic rope attachment to another rigidbody object - ghawstie - 21-12-2021 Update: I connected the rope directly to the player, and thus now behaves correctly. The only issue is that as I move the camera up and down, the rope's start point remains at a fixed height, not moving up and down with the gun. RE: Connect dynamic rope attachment to another rigidbody object - josemendez - 21-12-2021 (21-12-2021, 02:50 PM)ghawstie Wrote: Update: I connected the rope directly to the player, and thus now behaves correctly. The only issue is that as I move the camera up and down, the rope's start point remains at a fixed height, not moving up and down with the gun. As long as your character has a rigidbody component, you can attach the rope to any other collider below its hierarchy. There's no need to attach the rope directly to the player, or to have a second rigidbody at the fire source. I'd try attaching the rope to your gun, then placing a single rigidbody component in your character's gameObject. This should work because the rigidbody "used" by any collider in Unity is the first rigidbody found up its hierarchy. Let me know if you need further help! RE: Connect dynamic rope attachment to another rigidbody object - ghawstie - 21-12-2021 (21-12-2021, 03:04 PM)josemendez Wrote: As long as your character has a rigidbody component, you can attach the rope to any other collider below its hierarchy. There's no need to attach the rope directly to the player, or to have a second rigidbody at the fire source. I'd try attaching the rope to your gun, then placing a single rigidbody component in your character's gameObject. Oh wow it works. xd I can't believe the solution was that simple all along... Thanks! I was using multiple rigidbodies because I was trying to use joints to link objects, but apparently there is no need for that. xd |