|
I'm using this script to shoot: But it does not shoot properly. When I turn right it does not shoot, it just creates the bullet in front of the gun. Also when I shoot at certain angles it does not shoot to where I am aiming it shoots to the left. Besides this it works fine. What am I doing wrong?
(comments are locked)
|
|
You need to change "Quaternion.identity", which aligns the rotation to the world axis, to "transform.rotation" or "spawnPoint.transform.rotation" and maybe change "transform.forward" to "bullet.transform.forward" Thank you, it worked!
Jul 23 '12 at 08:24 PM
Sandr0G
(comments are locked)
|
|
hi! the spawnPoint is a bit forward the gun and is a child of maincamera?
(comments are locked)
|
|
Hi i was using this script var bulletPrefab:Transform; function Update () { if(Input.GetButtonDown("Fire1")) { //Direction of bullet and add force bullet.rigidbody.AddForce(bullet.transform.forward * 5000); } } first of all i cant drag a bullet prefab to inspector of my rifle and it wont shoot
(comments are locked)
|
