Rope connecting two players

Godot Version

4.1.1 C#

Question

Hello :wave:!
I’ve been working on a co-op platformer game similar to Black and White, but both players are connected by a rope, however, the rope stretches and bugs out.

My current code is attached, any help is appreciated.
Thanks in advance!!

Your code is not here. PS: use the </> tool to format it.

@dbat Its a hyperlink

Duh! Sorry, missed that somehow. :smile:

I don’t have or use C# on my system. If I get a chance, I’ll try to make sense of your code, but you may have better luck if you:

  1. make a minimum version of the problem
  2. maybe convert it to gdscript, but that’s not a must
  3. post more about the issue. some images perhaps.

It’s in gdscript, but I have the c# version is so I can use qodot. Should’ve mentioned! :man_facepalming::man_facepalming:

PS - Another project you might like re BSP. GitHub - jitspoe/godot_bsp_importer: An importer addon to import Quake BSP files.

@dbat Thanks, I’ll look into it.

Sorry I’m being useless helping you. If you’ve not solved it yet, take it a step at a time and just be patient. These kinds of problems often get solved almost by random. Sometimes your mind is just on the ball that day, or you wake up with an idea.

Hey buddy,

I checked your project and the issue is your floorChecks in the player scripts are not picking up the floor correctly (you can see for yourself if you print ‘on_floor’ while they are on the floor). I moved them into the body a little bit and it works better but it doesn’t always pick it up.

I think 2 raycasts, one on each side, like in the last pic, could work better. I think your floor check could be like this (but I’ll leave you to fill in the gaps):

on_floor = $raycast_left.is_colliding() || $raycast_right.is_colliding()

Before:

After:

See here:

Raycast suggestion:

1 Like