Hello. This is the code I am using to fire a projectile for a 2D game(It just fires the projectile straight up along the z axis). Is there anyway I can have it fire from 10 units along the x axis (so it would be firing straight up from the right of where the object this script is attached to is)? Thanks
Did you mean 10 units right of your object in local space or world space?
var rotation = transform.rotation;
var position = transform.position + Vector3.right * 10;
// Or if you want local offset:
// var position = transform.position + transform.right * 10;
var clone : Rigidbody = Instantiate(projectile, position, rotation);
clone.velocity = transform.forward * projectilespeed;
Physics.IgnoreCollision(clone.collider, transform.root.collider);