`using UnityEngine;
using System.Collections;
//THIS SCRIPT MAKES UNITY CRASH-------------FIGURE OUT WHY
public class weaponProjectileInst : MonoBehaviour
{
public bool hasntHitAnything = true; //condition for while loop
public float bulletSpeedValue;
public float bulletDropValue;
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
while (hasntHitAnything == true)//code for bullet drop and stuff here
{
transform.Translate(Vector3.forward * Time.deltaTime * bulletSpeedValue);//Move Forward
transform.Translate(Vector3.down * Time.deltaTime * bulletDropValue);//bullet drop
}
}
void OnTriggerEnter(Collider other)
{
hasntHitAnything = false;
Destroy(this);
}
}
`
so basically i was starting out with some code for a projectile script, but everysingle time it makes unity crash