Does CharacterBody2D work with DampenedSpringJoint2D?

Godot Version

4.2.1

Question

Does CharacterBody2D work with DampenedSpringJoint2D at all?
I tried connecting a CharacterBody2D to a RigidBody2D using a DampenedSpringJoint2D to create a rope-like bond that could never separate, kinda like bread and fred, but yeha it didn’t work at all and now I have no idea why or even how to fix it because i cant find anything to print (i may be dumb)

I tried switching node a to node b
I kept on changing every property/variable of the Joint and other nodes
Changed the player’s movement multiple times
but eventually i just gave up and created the code below to make a really wonky rope

#anvil is the rigid body, the code below is in the player/character body's script
func _physics_process(delta):
	
	anvil_look.look_at(anvil.position)
	
	if position.distance_to(anvil.position) > rope_length:
		velocity = Vector2(SPEED * position.distance_to(anvil.position) / rope_length, 0).rotated(anvil_look.rotation)
		move_and_slide()

it’s really scuffed so i would appreciate some help or maybe an alternative way to do this

thanks!

If the issue is that the CharacterBody2D is not moving with the joint then that’s normal.

CharacterBody2D main functionality is that is user-controlled. You can fully control it via code and it won’t be affected by external forces.

1 Like

If you want your character to be controlled by physics you can use a RigidBody and just bind the controls to applying central forces to it.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.