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

Meele System problem

$
0
0
for some reason my melee system won't work it's using raycasts and I did everything right where i make a empty gameobject on the main camera on the player but still nothing. please help me asap! Thx ALSO WHOEVER GETS IT RIGHT WILL GET A COPY OF THE GAME WHEN FINISHED #pragma strict var TheDammage : int = 50; var Distance : float; var MaxDistance : float = 1.5; var TheSystem : Transform; function Update () { if (Input.GetButtonDown("Fire1")) { //GetComponent.().Play("Attack"); } } 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 7934

Latest Images

Trending Articles



Latest Images

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