Make another object move along with animation?

Hello, so I’m currently trying to make a 2D Space dogfighting game and am trying to work out some basic animation work atm. So my player ship has a “transforming” feature though all it really is the sides of the ship expanding outwards from the core of the ship. But the problem is that there are objects attached to the sides of the ship, mainly the main guns and missile rack. I made them separate (A child of the ship gameobject) so that I can implement multiple pieces of equipment for the player. So in my current setup, wouldn’t I also need transformation animations for the weapons, which is really just them moving side to side? Is there a way to move the attached objects along with the sides of the ship without resorting to additional animations?

Hi,
You can do it by code

public Transform ObjectToMove;

//Function you want to call when your objects should be moved
public void ChangePositions()
{
ObjectToMove.position = new Vector3(x,y,z); //x,y,z are positions you want your objects to me moved to
}