How to know how close things are using position

how do I use two objects position to find out there distance?

I just count the number of blocks between them. Probably not the most helpful

no, its not helpful. Not at all

1 Like

I’m talking about finding the distance between two positions like how far away are 12x and 49y from 19x from -99y or something like that.

1 Like

Refer to this topic and I think it’ll help. Tell me if not

you could try using the “proximity” block

1 Like

@Rusnorful
This should work:

{"data":{"behavior":{"v":"2","nodes":[{"inputCount":5,"outputCount":1,"name":"Get Distance","behaviorType":"logic.NodeGroup","x":-450,"y":-16,"group":"f84975a79e4ef84d","id":"fbb4e60f454e454e","notes":"How to use:\nGets the distance between two objects\n\nInputs:\n\nTarget X:\nThe Target objects X position.\n\nTarget Y:\nThe Target object's Y Position.\n\nThis X:\nThe Current Objects X Position.\n\nThis Y:\nThe Current Objects Y Position.\n\nGet:\nGet the distance between the two objects (Outputs the distance between the last values entered! You must update if either object is moved!)","isMenuItem":false},{"expression":"Math.sqrt((A - C)^2 + (B - D)^2)","default0":0,"default1":0,"default2":0,"default3":0,"default4":0,"default5":0,"params":4,"version":2,"tag":"","inputCount":5,"outputCount":1,"name":"Expression","behaviorType":"logic.logic.Expression","x":-180,"y":32,"group":"fbb4e60f454e454e","id":"fbb4e611ad589c4c"},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-450,"y":-128,"group":"fbb4e60f454e454e","id":"fbb4e61175f2cf4e","portId":"fbb4e60f454e454ei0","tag":"Target X","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-450,"y":-32,"group":"fbb4e60f454e454e","id":"fbb4e6119138e14c","portId":"fbb4e60f454e454ei1","tag":"Target Y","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-450,"y":48,"group":"fbb4e60f454e454e","id":"fbb4e61136c9cd48","portId":"fbb4e60f454e454ei2","tag":"This X","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-450,"y":128,"group":"fbb4e60f454e454e","id":"fbb4e61173b6bd4b","portId":"fbb4e60f454e454ei3","tag":"This Y","dataType":2},{"inputCount":0,"outputCount":1,"name":"Bundle Input","behaviorType":"logic.NodeGroupInput","x":-450,"y":208,"group":"fbb4e60f454e454e","id":"fbb4e611c11ab64d","portId":"fbb4e60f454e454ei4","tag":"Get","dataType":2},{"inputCount":1,"outputCount":0,"name":"Bundle Output","behaviorType":"logic.NodeGroupOutput","x":0,"y":64,"group":"fbb4e60f454e454e","id":"fbb4e611f5da994b","portId":"fbb4e60f454e454eo0","tag":"Distance","dataType":2}],"links":[{"input_id":"fbb4e611f5da994bi0","output_id":"fbb4e611ad589c4co0"},{"input_id":"fbb4e611ad589c4ci0","output_id":"fbb4e61175f2cf4eo0"},{"input_id":"fbb4e611ad589c4ci1","output_id":"fbb4e6119138e14co0"},{"input_id":"fbb4e611ad589c4ci2","output_id":"fbb4e61136c9cd48o0"},{"input_id":"fbb4e611ad589c4ci3","output_id":"fbb4e61173b6bd4bo0"},{"input_id":"fbb4e611ad589c4ci4","output_id":"fbb4e611c11ab64do0"}]}}}

Here’s my Distance bundle:

1 Like

This has two inputs for x and y but how does it find the distance between two positions? do I just subtract the two positions pixels using this?

I can’t get this to work dude

Inside the bundle uses This X and This Y extractors, you just need to input the targets X and Y position.

1 Like

ok thanks you 20000000characterrrrs

1 Like

just try this for character < something random > (no spaces)

didn’t work dududududud

No symbols either!

image

But it doesn’t worK, I typeD thiS:

1 Like

WHAT its gone?

1 Like

Oh, I understand, I though this was meant to be all that was in the message but it’s something that disappears, ok I get it

3 Likes

To the right of the text box, you should be able to see what the text should look like. (it’s blocked by that “this topic is now…”, just click the esc button on it)

1 Like