I have an object which destroys itself then creates a new object at the same time and it works fine. The rotation and everything is all the same but the velocity resets which doesn't really make it seem that seamless. So is there a way i can get the instantiated object to continue with its parent's velocity?
You can set the object's velocity immediately after instantiating it.
In general, you shouldn't use the ability to set velocity directly as a method of controlling or moving the object (you should apply forces instead), but in this situation where you are setting its initial velocity after creating it, it should be fine:
// create the new object
var newObject = Instantiate( sourceObject, position, rotation );
// give it the same velocity as the current object
newObject.rigidbody.velocity = rigidbody.velocity;
newObject.angularVelocity = rigidbody.angularVelocity;
// destroy this object
Destroy(gameObject);
You might also find that you need to set up an IgnoreCollision between the old and new objects - if they both have colliders, there's a chance a physics update may occur while they both exist in the same position.
{
//Get parent ship velocity
Vector3 shipVelocity = PlayerShip.GetComponent().velocity;
//spawn projectile
GameObject shot = Instantiate(ammoType, firePoint.position, firePoint.rotation);
//create vector3 to store ship velocity
Vector3 velocity = new Vector3(shipVelocity.x, shipVelocity.y, shipVelocity.z);
//get RB component of bullet
rb = shot.GetComponent<Rigidbody2D>();
rb.velocity = velocity;
//if you want to add force to it, and have it maintain rotation of your parent object
rb.AddForce(firePoint.up* bulletSpeed, ForceMode2D.Impulse);
Destroy(shot, bulletLifespan);
}