Hi Unity community,
I’m workin on a project which is to do with wind dynamics in Unity, assigning the wind to the grass and trees is easy though to code it is hard but another thing I wanted to have influence by the wind is the projectile. However I’m finding it hard just to fire my bow and arrow from a first person view the bow and arrow are attached as one object. If anyone can help I’ll be grateful, below is the attached script for the bow and arrow.
var Bowandarrow:Transform;
var shootforce:float;
function Update () {
if(Input.GetMouseButtonUp(0))
{
var instanceBowandarrow = Instantiate(Bowandarrow, transform.position, transform.rotation);
instanceBowandarrow.rigidbody.AddForce(transform.forward * shootforce);
}
}