does anyone know what this means
I get this in my code on line 34-36 and then it freezes up everything, but it works perfectly fine with similar code a few lines down on line 42-44 and i can’t find anything on google about this. if anyone could help it would be appreciated. here is my code.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR;
public class gunmagizen : MonoBehaviour
{
public GameObject [] bullets;
public int bnumber;
public float bnumberfloat;
public bool minus = false;
public hand hand;
public bool pluse = false;
public GameObject bottem;
bool minusdone = false;
bool plusdone = false;
// Start is called before the first frame update
void Start()
{
bnumber = bullets.Length;
}
// Update is called once per frame
void Update()
{
if (bnumber > bullets.Length)
{
bnumber = bullets.Length;
}
bnumberfloat = bnumber;
if (minus && bnumberfloat - 1 > -1 && minusdone == false)
{
Debug.Log(bnumber);
bullets[bnumber].GetComponent<Collider>().enabled = false;
bullets[bnumber].GetComponent<MeshRenderer>().enabled = false;
bottem.transform.position = bullets[bnumber].transform.position;
bnumber--;
minusdone = true;
}
if (pluse && bnumber < bullets.Length && plusdone == false)
{
bullets[bnumber].GetComponent<Collider>().enabled = true;
bullets[bnumber].GetComponent<MeshRenderer>().enabled = true;
bottem.transform.position = bullets[bnumber].transform.position;
bnumber++;
plusdone = true;
}
if (hand.leftgrip)
{
minus = true;
}
else
{
minus = false;
minusdone = false;
}
if (hand.rightgrip)
{
pluse = true;
}
else
{
pluse = false;
plusdone = false;
}
}
}