Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Cannot implicitly convert type `UnityEngine.Vector3' to `bool'

$
0
0
hi im doing a follow path for a enemy but im getting this error:> error CS0029: Cannot implicitly convert type `UnityEngine.Vector3' to `bool' here my code: IEnumerator FollowPath(Vector3[] waypoints) { transform.position = waypoints[0]; int targetWaypointIndex = 1; Vector3 targetWaypoint = waypoints[targetWaypointIndex]; while (true) { transform.position = Vector3.MoveTowards(transform.position, targetWaypoint, speed * Time.deltaTime); if (transform.position = targetWaypoint) //error comes at this line { targetWaypointIndex = (targetWaypointIndex + 1) % waypoints.Length; targetWaypoint = waypoints[targetWaypointIndex]; yield return new WaitForSeconds(waitTime); } yield return null; } } what im doing wrong????

Viewing all articles
Browse latest Browse all 2891

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>