Hello,
I would like to make my arrow shoot to my crosshair.
Right now it is turned sideways. How can i get it’s head to go like a normal arrow?
PrefabShooting:
using UnityEngine;
using System.Collections;
public class PrefabShooting : MonoBehaviour
{
public Rigidbody theBullet;
public int speed = 65;
void Update()
{
if (Input.GetMouseButtonDown(0))
{
Rigidbody clone = Instantiate(theBullet, transform.position, transform.rotation) as Rigidbody;
clone.velocity = transform.TransformDirection(Vector3.forward * speed);
Destroy(clone.gameObject, 3);
}
}
}
ArrowDamage:
using UnityEngine;
using System.Collections;
public class ArrowDamage : MonoBehaviour {
public int Damage = 25;
void OnCollisionEnter(Collision info) {
info.transform.SendMessage("ApplyDamage", Damage, SendMessageOptions.DontRequireReceiver);
}
}