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: Code (csharp): 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: Code (csharp): using UnityEngine; using System.Collections; public class ArrowDamage : MonoBehaviour { public int Damage = 25; void OnCollisionEnter(Collision info) { info.transform.SendMessage("ApplyDamage", Damage, SendMessageOptions.DontRequireReceiver); } }
I guess if you use Code (CSharp): transform.Translate(Vector3.forward * Time.deltaTime * movementSpeed); it will be better. If that does not fix the issue, I'd suggest you to look up the transform.rotation of the current object your script is attached to, as you're getting its transform.rotation to pass through to the clone. Make sure that the gameobject the script is attached to has the right sides, meaning its left is not back, and right is not forward etc! Some gameobjects, or better to say the actual models are modeled poorly, which results in issues like that! Or else, you can also use a parent gameobject in order to get the correct rotation.