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

Code Question

$
0
0
Hello Unity Community! I have tried to fix this, but I just can't. What is the problem with this code!?!? Thanks, Calvin using UnityEngine; using System.Collections; public class MeleeSystem : MonoBehaviour { public int TheDamage = 50; public float Distance; void Update() { if (Input.GetButtonDown ("Fire1")) { RaycastHit hit = RaycastHit; if (Physics.Raycast (transform.position, transform.TransformDirection (Vector3.forward), hit)) { Distance = hit.distance; hit.transform.SendMessage ("ApplyDamage", TheDamage, SendMessageOptions.DontRequireReceiver); } } } }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



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