Open ProbablyIdiot opened 3 weeks ago
First thing you should do is change the StaticBodies to CharacterBodies (or KinematicBodies in 3.x). This has nothing to do with this plugin but is a general rule of thumb. StaticBodies are used for static geometry. If they move, they usually shouldn't be static.
Now to the problem: What you are planning won't work at the moment. There is no way to fixate the rope at the start AND end point. That means the player at the end of the rope will always be pulled towards the other player, but not the other way round. Getting a grabbing and pulling logic to work in the first place is a little complicated to explain without example.
I will try to get back to in the next few days, maybe end of the week, depending on whether I find some time. It's been on my list for a while to finally upload a rope grabbing example project.
Also, #9 is slightly related regarding how RopeHandle
s work and why the gap appears.
If you just want to limit movement, you could also just add a restriction to your player movement code that doesn't allow the player to move further than a certain maximum distance from the other player.
Thanks for the info, I probably won't be able to get back to you soon, as I have become ill. Thanks againa though.
Small status update: I'm currently working on making rope endpoint behavior more configurable. That means an option whether the beginning and/or ending should be fixed or loose. This should make your use-case possible to achieve. I will also try to include an example project.
@mphe , Sorry for not replying, I've been completely caught up in school tests. I think I'll take the advice on using CharacterBodies and wait for the update. Thanks for the work you do!
So did you already solve it or did you gave up?
@mphe Im just going to wait for the update you mentioned, the game I’m making is just to learn more about the engine, so I’m doing other projects in the meantime.
I'll reopen then until it is solved.
I've been working on an efficient way to completely fixate points and also an option to detach the rope's beginning from the node's position. You can try out on the endpoint_fixation branch or download a build from the latest build workflow. The new version also includes much more example scenes.
I'll also try to get a rope pulling example working this week and add it to the project. The overall setup will be:
fixate_begin = false
on the Rope
RopeHandle
s at the beginning and end of the rope with strength = 1.0
RopeAnchor
s at the beginning and end of the rope.RopeHandle
s on_before_update
signal and sets the position to the respective CharacterBody
positionRopeAnchor
s on_after_update
signal and set the position of the CharacterBody
s to the anchors position, preferabily with a move_and_slide
to prevent the objects from getting pulled into terrain.
Hello, I've been working on a game where there are two players that are connected by a rope. The players are made up of StaticBodies and can move independantly of each other. What I need help with is making the rope pull on each player, or at least limit the movement, instead of just creating a gap (video attached as zip, as it is too big). RopeBound (DEBUG) 2024-06-25 12-09-41.zip