How to convert an int3 to a vector3? I have tried this but that doesn’t seem to work:
`function FindNearest(pos : Vector3) {
var Nearest : Vector3;
var Nodes : GraphNode[] = Graph.nodes;
for (var i = 0; i < Nodes.Length; i++) {
var NodePos = Int3ToVector3(Nodes[i].position);
if (Vector3.Distance(NodePos, tr.position) > Vector3.Distance(Nearest, tr.position)) {
Nearest = NodePos;
}
}
return Nearest;
}
function Int3ToVector3(INT : Pathfinding.Int3) {
return new Vector3(INT.x,INT.y,INT.z)/1000.0f;
}`
The Int3ToVector3 gives me a Vector3.zero, but if I divide it by 100.0f instead it gives me the right parameters, but one 0 to much.