Hello,
I have a little problem with my game.
My bullets are going to the right and not stright forward?
My bullet code:
#pragma strict
var SpeedBullet : float = 500;
function Start () {
rigidbody.AddForce(transform.forward * SpeedBullet);
}
My first spawn bullet code:
function FireOneBullet () {
Instantiate(Bullet, FirePoint.transform.position, transform.rotation);
Ammo--;
}
Fluzing
2
Place your bullet in an empty gameobject and turn the bullet in the correct direction.
Ian094
3
Make sure that your Fire point is facing forward (Z Axis).
uy
4
A quick and easy fix would be to not change the actual object, and change the transform.forward to -transform.right
Thx it works but i have an other problem if i am shooting my capsule is vertical and it needs to be horizontal?
uy
6
then you should probably go with what fluzing said, and go back to the transform.forward, and apply the script to the empty and not the bullet