Goals

  • Create single script that maintains a 2-way connection between 1 or more rigidbodies
  • Should allow for connections between the player, grapple objects, regular objects, and kinematic objects
  • Player and world should be able to interact with rope: split, move either transform, etc.
  • Rope should only create physics options where necessary, allowing player + grappleobjects to do any wonky physics stuff as needed

Should all in-world objects that can be connected to ropes be considered grapple objects? Can we just use that solution?

  • grappleobject custom constraints method doesn’t seem to work well for midair hanging objects
  • Either update that system or figure out why using a joint isn’t viable

Long chains of grapple objects probably won’t ever exist Could be cool for the option to be there but not a big gameplay thing

Abstract subclass for updating constraints that playercontroller and grappleobjects can inherit

Unified solution

Creating rope

  • Two options for spawning: Instantaneous, or with “shooting out” motion akin to grapple hook
  • After completing rope spawn visuals: Create

Maintaining rope connection

  • Player currently uses “UpdateGrapple” method - move to ropeconnection script
  • GrappleObjects have “update constraints” method - rough approximation of physics joint that should(?) also allow for chaining many objects together Destroying rope Rope collider triggers

Current things to declutter

  • Connection script should be able to communicate to connections when something is established / removed
  • Would make sense to use grapplepoints instead of rbs in connection data
    • How to store player if this is the case?
      • Could try just throwing the script on the player
      • RB ref should work itself out
    • How to communicate to GrappleObject when child RB is in control?
      • I think grapplepoint rb ref is assigned to parent GO if present

In editor: Store transforms only At runtime: Assign everything properly?

GrappleObject notes

  • Constraints are based on distance to point, not current rope length
  • Constraints seem to kick in at 2.5 units shorter than player rope
    • i.e. player joint is 2.5 units longer than grappleobject constraints
    • See objectBonus variable - use that for player joint calc only, don’t include in connection length setting