Game Development Community

Distance

by Quentin Headen · in Torque Game Engine · 02/14/2007 (3:13 pm) · 1 replies

I have one question. In my game there is an Ai wheeled vehicle. When I say setMoveDestination() I just wanted to know if there is a way I can get the distance my car is from the destination. Please let me know this.

Thank you.

About the author

Just your average programmer who tries to finish the projects he starts. :) I am currently focused on creating games with Torque engines. My website is http://phaseshiftsoftware.com


#1
02/14/2007 (9:57 pm)
Yes indeed--I just asked this question the other day. What you want is some variation on:

%dist=vectorDist(%this.getPosition(), %node.getPosition());

woo woo! I knew the answer to someone's question!

Just out of curiousity, why do you want to know? I was tinkering with ways to get vehicles to slow down better for complex paths. Ended up doing it rather differently...