create shortest AI path from/to object.

Hey, I know how to make an object move to a waypoint, and after that another, but how do I get it make its own route through the waypoints to a goal in Javascript?

If you have waypoint nodes in your level you can use the A* algorithm A* (wikipedia) If you're not a programmer you should search if someone already wrote an A*-algorithm for Unity or try it yourself.

A* works for almost every pathfinding problem in 2D tiled maps or in 3D maps with nodes. good luck