I guess you could also store the array index as the name of each sphere:
Or, a better solution would be to have your waypoints as an array of Types, and just store the index as one of the Fields. This will allow you to store other info related to each waypoint, which you may want to do later on:
waypoint_ent = CreateSphere() Const MAX_WAYPOINTS = 100 Dim waypoint(MAX_WAYPOINTS) For n = 1 To MAX_WAYPOINTS waypoint(n) = CopyEntity(waypoint_ent) NameEntity waypoint(n),n Next . . . picked_wp = CameraPick(cam,MouseX(),MouseY()) If picked_wp Then Text MouseX(),MouseY(),"Waypoint No: " + EntityName$(picked_wp)
Or, a better solution would be to have your waypoints as an array of Types, and just store the index as one of the Fields. This will allow you to store other info related to each waypoint, which you may want to do later on:
Type waypointT Field ent Field index . . . End Type