I have a bunch of area nodes placed at different distances from the player - I want to use them to measure the length of a throw of a rigid body by the player. Basically, the length would be measured by area nodes emitting signals to a 'measurement' function once the rigid body hits the ground in their area (ie, enters them).
I want to only build one function to collect the lengths and display them, therefore I am thinking of passing a length value from each area node into the display function's length variable. Something like this:
Area node's code:
onready var thrownObject = get_node(“root/thrownObject")
connect("body_entered", thrownObject, “measure_length.length_variable = 1000”)
Display function's code:
if body.name == “thrownObject”
print(“Object landed on 1000”)
Or something along these lines. What would be the best method to achieve this?