|
Hello, I'm working on a simple melee system, basically I have an axe, that every time you click, an animation plays of your character swinging the axe. Also on the script, I have a raycast system, that detects the distance of the player and the enemy. If the distance is close enough, then allow the 'melee click' to do damage (SendMessage). But it doesn't seem to be working. I think I've narrowed it down to my SendMessage event, not sure if thats getting across for some reason, anyway, have a look and let me know what you think. (Right now, there is no 'click' as soon as the player gets close to the enemy, it will trigger the damage):
(comments are locked)
|
|
I had several troubles once trying this raycast approach: the ray were too high or too low, started behind the point I supposed, hit the character collider, and many others.
...
if(Physics.Raycast (transform.position, direction, hit, Mathf.Infinity, layerMask)){
Debug.DrawLine (transform.position, hit.point, Color.blue, 1);
if(hit.distance
(comments are locked)
|
