Quantcast
Channel: Questions in topic: "melee"
Viewing all articles
Browse latest Browse all 201

Melee system error help!

$
0
0
Why wont this work i cant hit my enemy at all and theres no errors coming up put it wont hit the enemy when i click my mouse Script: #pragma strict var TheDammage : int = 50; var Distance : float; var MaxDistance : float = 1.5; var TheSystem : Transform; function Update () { if (Input.GetButtonDown("Fire1")) { } } function AttackDammage () { //Attack function var hit : RaycastHit; if (Physics.Raycast (TheSystem.transform.position, TheSystem.transform.TransformDirection(Vector3.forward), hit)) { Distance = hit.distance; if (Distance < MaxDistance) { hit.transform.SendMessage("ApplyDammage", TheDammage, SendMessageOptions.DontRequireReceiver); } } }

Viewing all articles
Browse latest Browse all 201

Trending Articles



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