# Combined Action¶

A Combined Action has the attribute to perform multiple sub-actions sequentially. Sub-actions consist of any other type of Actions described in this section.

For example, to have an Insert Action followed by a Remove Action but consider both as one whole action, use the Combined Action prototype as described in this section.

To create a Combined Action follow the same ideology as the other prototypes with the difference that you need to define a gameobject for each sub-action you wish to insert.

For example,

public class AssembleKnossosPartOfAction : CombinedAction
{
public override void Initialize()
{

//InsertAction sub-Action
insertFrontGateAction.SetInsertPrefab("Lesson0/Stage1/Action0/FrontPartInteractable",
"Lesson0/Stage1/Action0/FrontPartFinal");
insertFrontGateAction.SetHoloObject("Lesson0/Stage1/Action0/Hologram/FrontPartHologram");

//--------------------------------------------------------------------------------------------
//InsertAction sub - Action
insertBackGateAction.SetInsertPrefab("Lesson0/Stage1/Action0/BackPartInteractable",
"Lesson0/Stage1/Action0/BackPartFinal");
insertBackGateAction.SetHoloObject("Lesson0/Stage1/Action0/Hologram/BackPartHologram");
//--------------------------------------------------------------------------------------------
//ToolAction sub - Action
hitWithMallet.SetToolActionPrefab("Lesson0/Stage1/Action0/BackPartHitMallet", MAGES.ToolManager.tool.ToolsEnum.Mallet);
hitWithMallet.SetHoloObject("Lesson0/Stage1/Action0/Hologram/MalletHologramL0S1A0");

InsertIActions(insertFrontGateAction, insertBackGateAction, hitWithMallet);

base.Initialize();
}
}


## Action Script Explanation¶

The action prototype gameobjects are first defined and later set using each prototype’s rule (e.g., an Insert Action needs SetInsertPrefab, a Tool Action needs SetToolActionPrefab, and so on).

Finally, you need to finalize the Combined Action’s setup by calling an InsertAction’s function with parameters the sub-actions objects you created before.