Rotating an Arrow

Before starting, yes I have seen this question Realistic rotation of flying arrow? - Questions & Answers - Unity Discussions but the solutions suggested there are not working for me.

I have a script to shoot. Muzzle is an empty GameObject with the point where the bullet will be fired from. I apply a rotation because the arrow is in vertical when I instatiate it.

using UnityEngine;

public class Shoot : MonoBehaviour
{
	public Transform muzzle;
	public Rigidbody bullet;

	public void Update()
	{
		if (Input.GetMouseButtonDown(0))
		{
			Rigidbody b = GameObject.Instantiate(bullet, muzzle.position, muzzle.rotation) as Rigidbody;
			b.transform.Rotate(90, 0, 0);
			b.AddForce(b.transform.up * 500);
		}	
	}
}

I tried both solutions suggested in the first link to control the arrow rotation, but it doesn’t fly the way one should expect. The arrow doesn’t keep the initial rotation and reorients itself in a wrong way. The script attached to the arrow is this:

using UnityEngine;

public class ArrowControl : MonoBehaviour
{
	public void Start()
	{
		GameObject.Destroy(gameObject, 10);	
	}

	public void Update()
	{
		transform.forward = Vector3.Slerp(transform.forward, rigidbody.velocity.normalized, 10 * Time.deltaTime);
		//rigidbody.rotation = Quaternion.LookRotation(rigidbody.velocity);  
	}
}

Any suggestion to make the arrow behave properly during the flight?

I may be wrong, but it seems that you are the culprit! You’ve instantiated the arrow, rotated it to the correct orientation (transform.up seems to be the arrow tip) and fired it in the correct direction, but while flying you’re aligning transform.forward to the velocity direction. You should replace transform.forward by transform.up in both places in the Slerp instruction.

I think you’re right, I managed to solve the problem with another solution, using

transform.LookAt(transform.position - rigidbody.velocity);
transform.Rotate(90, 0 , 0);

Thanks for your help