using UnityEngine;
using System.Collections;
public class NewBehaviourScript2 : MonoBehaviour {
GameObject GrenadePrefab;
void Update ()
{
if(Input.GetButtonDown("Fire1"))
{
GameObject Grenade = Instantiate(GrenadePrefab, transform.position, transform.rotation) as GameObject;
Grenade.rigidbody.AddForce(transform.forward * 4000);
}
}
}
The code works perfectly but how do i get the bullet to shoot and from the camera view?
↧