Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

Why does this script make unity crash?

$
0
0
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

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>