-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RopeInteraction node overstretching. #16
Comments
See also the |
@mphe Sorry I only just saw this, they were already set with those settings. |
Could you upload a minimal reproduction project? |
https://drive.google.com/file/d/1O7AIIKTFIekjGFVu8Pni12vls6Yns4Mv/view?usp=sharing |
If it's too large for Github, it's not minimal :) Anyway, I think I know what the problem is and it is indeed a ropesim bug. I will try to look into it over the weekend. Like this: extends CharacterBody2D
@onready var PLAYER = $"."
@onready var SPRITE = $"Sprite2D"
@onready var ANIM = $AnimationPlayer
@export var vertSpeed = -750
@export var speed = 400
@export var gravity = 2500
@export var other_player: Node2D # NEW
var onfloor = false
var jumptimes = 1
func _physics_process(delta):
# Is CharacterBody on floor:
if is_on_floor():
onfloor = true
jumptimes = 0
else:
onfloor = false
# NEW
if not is_on_floor() and not (abs(other_player.global_position.y - global_position.y) > 200 and velocity.y > 0):
velocity.y += gravity * delta
velocity.x = Input.get_axis("blue-left", "blue-right") * speed
if Input.is_action_just_pressed("blue-up") and jumptimes <= 1:
jumptimes += 1
velocity.y = vertSpeed
move_and_slide() |
I investigated some more and did some experimenting. There is actually another problem in addition to what I already mentioned. This is a problem that cannot be solved easily. A workaround I found was to dynamically set these properties to true when the respective player is on ground and to false when not. To solve the problem I mentioned in my last reply, you need to run the player These measurements should prevent overstretching. Another alternative solution to the There is still one thing that you need to address: the vertical velocity of the hanging player will still gradually increase without limit, which will cause further problems. |
@mphe I'm so sorry, I realised I forgot to thank you and close this issue! Your solution works a treat, thanks for all your hard work. |
Hello,
This leads on from the previous issue (#10 ), I followed your advice, updated to 1.3 and used the RopeInteraction node on 2 CharacterBody2Ds. However, if one of the players jumps off of the platform, they are not limited by the rope. I understand that this may not be a bug, so - if it isn't - how can I limit the distance between them. Video attached to explasin was too large, so I zipped it:
RopeBound (DEBUG) 2024-08-01 19-46-36.zip
The text was updated successfully, but these errors were encountered: