How to get distance between 2 objects...as a simple number?

If it can help you, thereafter some code extract of what I use to measure the distance between the end effector of a robot arm and a goal (see here IA, Python and Armory 3d/Blender) and maybe you could reuse :

// Fetch goal
var tr = iron.Scene.active.getChild(goalname).transform;
var goal = new iron.math.Vec4();
goal.set(tr.worldx(), tr.worldy(), tr.worldz()); 


var dist:Float = Vec4.distance(goal, effLoc);

1 Like