- Home /
Weird C# Errors CS1502 and CS1503
So I'm making a patrol enemy that has to move from one point to another and when I wanted to test what I had so far I got these CS1502 and CS1503 errors and I have no idea what they are
using UnityEngine;
using System.Collections;
public class Patrol : MonoBehaviour {
public Transform[] patrolPoints;
public float moveSpeed;
private int currentPoint;
// Use this for initialization
void Start () {
transform.position = patrolPoints[0].position;
currentPoint = 0;
}
// Update is called once per frame
void Update () {
if (transform.position == patrolPoints[currentPoint].position)
{
currentPoint++;
}
transform.position = Vector3.MoveTowards(transform, patrolPoints[currentPoint].position, moveSpeed * Time.deltaTime);
}
}
You're passing invalid data types to Vector3.$$anonymous$$oveTowards.
$$anonymous$$ost likely, you mean transform.position
ins$$anonymous$$d of just transform
.
on what lines? it could also be that currentPoint is larger than the amount of items in the array, do and if check if the currentPoint is less than patrolPoints.Length
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
How to Fix Compilier Errors? 0 Answers
MonoDevelope is not opening! 1 Answer
Out of Range Exception 1 Answer
i just got unity and when i open the program i get a error saying transaction is invalid 2 Answers