Ok, so here’s what happened. I’ve installed projectiles (bullets) to my game. However, there is a HUGE error. I tried to position my projectiles’ spawning point at my gun’s point. every time I enter the coordinates, it ends up somewhere else on the map, so I tried to do it manually, and I succeed at putting the multi-colored square at the gun’s point, but it fires at different points! Is this an editing or computer error? And if so, how can I fix it?
SCRIPT (Monodevelop)
var projectile : Rigidbody;
var speed = 200;
function Update () {
if (Input.GetButtonUp ("Fire1"))
{
clone = Instantiate(projectile, transform.position, transform.rotation);
clone.velocity = transform.TransformDirection(Vector3 (0,0,speed));
Destroy (clone.gameobject, 25);
}}