I am very new and would like some help with this error. Line 15 is where the error is. Ask me for more info if you need it.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class bullet2 : MonoBehaviour
{ private Vector3 velocity;
public float speed = 20;
public float damage = 15;
public boolet;
// Start is called before the first frame update
void Start()
{
velocity = transform.forward * speed;
}
// Update is called once per frame
void Update()
{
transform.position += velocity * Time.deltaTime;
Destroy (boolet, 5f);
}
void OnCollisionEnter (Collision collision)
{
GameObject objecthit = collision.collider.gameObject;
if (objecthit.CompareTag ("Player"))
{
objecthit.SendMessage ("Damage", damage, SendMessageOptions.DontRequireReceiver);
}
}
}