I am currently developing a lightweight 2.5D Spider-Man fan game inspired by the Nintendo DS version of Spider-Man: Shattered Dimensions.
I want to implement a simple web-swinging mechanic (pendulum motion on a fixed 2D plane), but I want to achieve this without using Python code. I prefer using Logic Nodes (Visual Scripting), Logic Bricks, or Physics Constraints (like Rigid Body Joints).
What I need help with:
How to cast a “web line” to a ceiling attachment point using nodes or logic bricks.
How to set up the physics constraint so the character swings smoothly like a pendulum without flying off the 2D axis.
How to release the swing and apply forward momentum.
If anyone has a template, a node setup screenshot, or advice on how to structure this visually, I would highly appreciate it!
I used the mouse raycast to a ghost plane with a property “centerplane” to get the position and put a preexisting object there. (left three nodes)
Then on leftclick-press I link the rigid-body sphere onto the cone as balljoint. On leftclick-release I undo the constraint. (right four nodes)
For convenience the cursor is shown and centered at the beginning (top three nodes)
This should give you a point to start from.
To constraint onto the 2d axis, you can use the hinge mode, but there are other things that can frack your alignment. You might want to consider using invisible collider planes so your player doesn’t fall off. Or use “set position” every once in a while to force the player object to recenter on the plane.
Obviously you’d want to use a raycast from your player to the mouse point to collide with anything so you can attatch your web there. you may add rope climbing, etc. and more. Note that it will get far more difficult to add proper rope physics. maybe you can do with a chain of intermediate links, but I’d go with raycasting and repositioning the anchor.