Hi i’m new in making game
i use unity for create my game and visual studio for my code and i have this message
NullReferenceException: Object reference not set to an instance of an object
Enemy.Update () (at Assets/Enemy.cs:17)
Can you help me please
I join my lign of code
using UnityEngine;
public class Enemy : MonoBehaviour {
public float speed = 10f;
private Transform target;
private int waypointIndex = 0;
void start()
{
target = waypoints.points[0];
}
private void Update()
{
Vector3 dir = target.position - transform.position;
transform.Translate(dir.normalized * speed * Time.deltaTime, Space.World);
}
}
Sorry for my bad english