Hello Everyone
i use this FireScript :
fireRate = fireRate - extrafirerate;
nextFire = Time.time + fireRate;
launchPosition = cameraHeadTransform.TransformPoint(0, 0, 0);
GameObject go = Instantiate(blaster, launchPosition, Quaternion.Euler(cameraHeadTransform.eulerAngles.x + 90,
transform.eulerAngles.y, 0)) as GameObject;
and in The Blaster[Bullet] prefab Added BlasterScript
myTransform.Translate(Vector3.up * 100 * Time.deltaTime);
Destroy(gameObject,1.5f);
The cameraHeadTransform = SpawnPoint its inside the player
i just want : When I Shoot, the bullet Go To Closest[Distance] Enemy With Tag “Enemy”
Thanks but not working :) I dont know, its just spawn the bullet very far away and under the ground .. hold on second ,, i should attack the script to the bullet or inside my firescipt anyway i tried both. i guess he got problem in finding the Tag
– D3m0nESorry, I didn't write it to work if you copied and pasted it directly into your code. I edited it, hopefully you can get it to work now. But your bullet is going to go up, unless you change your bullet to move Vector3.forward instead of Vector3.up
– janzdottIts Works Like Charm,, thank you but there is little problem that he aiming on the leg.. i fixed it by adding vector3 Vector3 bulletDirection = closestEnemy.transform.position-launchPosition+ new Vector3(0,1,0); its works but i'm not sure if its right way xD thx again
– D3m0nEGood I'm glad it worked, and sorry about the typo. Its hard writing code on a phone haha
– janzdott