hey guys it would be awesome if you could help me with a slight issue… basically i made a weapon which was a mace and just attached it to the main player camera… i was making a animation but then when i tested it it just ended up dissapearing… well it didnt but was off the screen and in the “scene” it show the mace like away from the camera and i cant see in in the player view… any ideas? here is the script i used for the weapon damage and stuff…
#pragma strict
var TheDamage : int = 50;
var Distance : float;
var MaxDistance : float = 1.5;
var TheMace : Transform;
function Update ()
{
if (Input.GetButtonDown("Fire1"))
{
TheMace.animation.Play("Attack");
var hit : RaycastHit;
if (Physics.Raycast (transform.position, transform.TransformDirection(Vector3.forward), hit))
{
Distance = hit.distance;
if (Distance < MaxDistance)
{
hit.transform.SendMessage("ApplyDamage", TheDamage, SendMessageOptions.DontRequireReceiver);
}
}
}
}
its not layout like shown… its in a proper scripting thing… for somereason its coming up like that