Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  3D Grappling Hook
#1
Hi, I have modified the GrapplingHook.cs script to work in 3D for my game.
I have encountered a bug that I am unsure how to fix. Here is a GIF of what currently happens in my game: https://gyazo.com/1a32cb32cf6e7bd19ddc004e1ec7c6b5

I am trying to make a grappling gun that shoots out of the end of the gun and then attaches to the clicked object which you can then shorten the rope to move towards.
I am also encountering the Player's Rigidbody moving since it's being influenced by the rope. Is there any way to only move the player once the rope becomes strained/has no slack remaining? I am trying to only "pull" the player towards the rope once it is ready to move.

Any help or guidance will be greatly appreciated!

Thanks Gran sonrisa
Reply
#2
(28-01-2021, 05:53 PM)AuKtagon Wrote: Hi, I have modified the GrapplingHook.cs script to work in 3D for my game.
I have encountered a bug that I am unsure how to fix. Here is a GIF of what currently happens in my game: https://gyazo.com/1a32cb32cf6e7bd19ddc004e1ec7c6b5

I am trying to make a grappling gun that shoots out of the end of the gun and then attaches to the clicked object which you can then shorten the rope to move towards.
I am also encountering the Player's Rigidbody moving since it's being influenced by the rope. Is there any way to only move the player once the rope becomes strained/has no slack remaining? I am trying to only "pull" the player towards the rope once it is ready to move.

Any help or guidance will be greatly appreciated!

Thanks Gran sonrisa

Hi there!

I don't see any bugs in the video, other than the rope is being spawned too far in front of the gun. I can help you fix that if you share the modified grapplinghook,cs you're using.

As for the player movement being influenced by the rope, you can control this just like you'd do in the real world: adjusting the mass of the rope and/or the player. If the player is heavier than the rope, rope movement won't affect him much unless the rope is pulling from him.

kind regards,
Reply
#3
(29-01-2021, 01:57 PM)josemendez Wrote: Hi there!

I don't see any bugs in the video, other than the rope is being spawned too far in front of the gun. I can help you fix that if you share the modified grapplinghook,cs you're using.

As for the player movement being influenced by the rope, you can control this just like you'd do in the real world: adjusting the mass of the rope and/or the player. If the player is heavier than the rope, rope movement won't affect him much unless the rope is pulling from him.

kind regards,
Hi Jose!

Thanks for the prompt response. I have the file attached here. Any help is greatly appreciated!

Thanks again!
Reply
#4
Hi there!

Sorry, I don't see any attachments to your last post Triste ! Maybe you didn't click "AddAttachment" after selecting the file?
Reply
#5
(29-01-2021, 05:42 PM)josemendez Wrote: Hi there!

Sorry, I don't see any attachments to your last post Triste ! Maybe you didn't click "AddAttachment" after selecting the file?

Hi there again!

Yeah, sorry haha, I forgot to click that.

Attached it now!


Attached Files
.cs   GrapplingHook.cs (Size: 6.78 KB / Downloads: 16)
Reply
#6
(29-01-2021, 05:42 PM)josemendez Wrote: Hi there!

Sorry, I don't see any attachments to your last post Triste ! Maybe you didn't click "AddAttachment" after selecting the file?

Hey again!

Just wondering if my file was okay and if you needed any assistance with it.
I am working on a GameJam and would love this ASAP if I can!
Hope all is welll!

Thanks Gran sonrisa
Reply
#7
Hi there!

I don't see anything wrong with the script you shared. Probably there's something going on in the scene setup itself. Do the rope and the character collider have the same phase? that can cause the rope to collide against it and get projected outside of the collider, it's the only thing that comes to mind.
Reply