I would like to make the Node B property of the PinJoint node a rigid body in the scene with code by pressing a button. Whenever I click the button it does not seem to work. If someone could explain this that would be great. Thanks in advance.
extends PinJoint
onready var block = $"/root/Spatial/Block"
func onButtonbuttondown():
set("nodes/node_b", block)
I have tested this code below to make sure the "block" is referenced correctly and it does work:
extends PinJoint
onready var block = $"/root/Spatial/Block"
func onButtonbuttondown():
block.gravity_scale = -5