This is close to fighting game collision I can get to. I used the collision from Brackeys. I’m setting up a forum for anybody interested in making a fighting game so everybody can learn to make a fighting game. If you have any improvements, put it on this forum. We have a “be nice” policy, if you have any smartass way of being a dick your reply will be reported.
var Damage : int = 50;
private var Distance : float;
var MaxDistance : float = 1.5;
var TheAnimator : Animator;
var DamageDelay : float = 0.6;
var straight;
function Update ()
{
AttackDammage();
}
function AttackDammage()
{
//Actual attacking
var hit : RaycastHit;
var ray = Camera.main.ScreenPointToRay(Vector3(Screen.width/2, Screen.height/2, 0));
if (Physics.Raycast (ray, hit))
{
Distance = hit.distance;
if (Distance < MaxDistance)
{
hit.transform.SendMessage(“ApplyDamage”, Damage, SendMessageOptions.DontRequireReceiver);
}
}
}[/code]