Question by
greenweb123 · Jul 28, 2017 at 04:17 PM ·
script.
I am having trouble with this melee script. It is keep telling me: Required to access non static member play.
pragma strict
var TheDammage : int = 50; var Distance : float;
function Update () { Animation.Play("Attack"); if (Input.GetButtonDown("Fire1")) { var hit : RaycastHit; if (Physics.Raycast (transform.position,transform.TransformDirection(Vector3.forward), hit)) { Distance = hit.distance; hit.transform.SendMessage("ApplyDammage", TheDammage, SendMessageOptions.DontRequireReceiver);
} }
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612131412im_/https://answers.unity.com/themes/thub/images/avi.jpg)