I have been trying to create a grappling tool for my game (the game basically revolves around it) with a pendulum-like set of physical properties for both the grapple and the player firing it. I have been able to get a slight swinging motion, but due to the way I’ve added the forces to the player, it acts like more of a spring
I’m using a rigidbody-Walker as my player, which means I can apply forces and connect joints. As for my ‘grapple’, I have a script attached to the player, and to the grapple-prefab. The player’s script fires the projectile, and the script on the grapple allows for collision checking, such as forming a FixedJoint with a wall, to lodge it inside. I also have a boolean to assess whether or not it is lodged in a wall, so I can apply forces or strengthen anchors and joints dependent on whether the grapple is;
a. travelling away from the player
or b. the player is travelling away from the grapple, and the grapple is lodged (in which case the grapple should be fixed, but the player should be limited by the cable attaching the two)
So in brief, I need some help with allowing the grapple to be, say, 100 metres from the player, but will stop sharply once it reaches 100 metres, like a real grappling hook.
Is there a way to create an effect simulating a realistic grappling hook?