0 votes

How can I get access to the computed points of a Joint2D object, so I can use them to _draw a rope between the 2 bound sprites?

Or is there any other, simpler way to do this?

The other question is how can I get the applied tensor strength so I can calculate the breaking point of a spring. It wold be great if the Joint class had a notification if the force applied to it exceeded the tensor limit.

in Engine by (17 points)
edited by

1 Answer

+1 vote

I'm not sure and I've not tried, but I think:

var j = get_node("path your joint")  # argument is your joint node      
var nodeA = j.get_node_a()
var nodeB = j.get_node_b()
var posNodeA = get_node(nodeA).get_pos()
var posNodeB = get_node(nodeB).get_pos()
by (1,468 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.