Hi I’m busy building an FPS part in my game but I’m unable to get the height of where the bullet is spawned right…
it keeps looking like I’m bowling or something…
I’m using the following code but I’m unable to find out why the bullets aren’t spawning at the right place…
function Start () {
count = 0.5;
speed = 40;
}
function Update () {
count = count + Time.deltaTime;
//print(count);
if(count >= 0.5){
if (Input.GetButton("Fire1")) {
var clone : Rigidbody;
clone = Instantiate(projectile, (transform.position + Vector3(0.3, 0, 0)), transform.rotation);
clone.velocity = transform.TransformDirection (Vector3.right * speed);
}
count = 0;
}