Create a simple schematic to set a combatant as the player and spawn it in the scene.
In this tutorial we’ll create the simplest and most basic start schematic to start a new game with ORK. All we have to do is add a combatant to the player’s group and spawn it in the scene.
Afterwards we’ll set up the schematic as ORK’s Start Schematic in UI > Start Menu, which allows us to use this in any scene we start in when using a game starter set up for quick game testing.
For this to work, you need:
- A combatant set up with a prefab.
- A scene with a Spawn Point added.
Setting up the Schematic #
Open the Makinom editor and navigate to Schematics. Create a new schematic, there is no additional setup needed in the Settings.
Join Group #
Add Node > Group > Group > Join Group
First, we’ll add a combatant to the player group.
- Group Origin
Select Active Player Group.
This’ll join the combatant to the currently active player group.
Select the combatant you want to join.
If you want to add multiple combatants to the player group, just add multiple Join Group nodes, each adding the combatant you want.
Spawn ORK Player #
Add Node > Game > Player > Spawn ORK Player
Now, we’ll spawn the player in the scene. This requires a Spawn Point component in the scene with a matching Spawn ID.
- Spawn At
Select Spawn Point.
- Spawn Point ID
Set to 0.
Or any other spawn ID you have in your scene and want to spawn at.
And that’s it for the schematic. Click on Save Schematic to save it, e.g. as StartGame.
Using the Schematic #
To use the schematic to join your player and spawn it, you can either set it up as the Start Schematic in UI > Start Menu or as an Auto Machine in a scene.
The easiest way (and being able to use it anywhere without additional setup) is to set it up as the start schematic, so that’s what we’ll do.
Navigate to UI > Start Menu in the Makinom editor and change the following settings.
New Game Settings #
- Start Schematic
Select the schematic you just set up.
And that’s it. Don’t forget to save the changes you did in the Makinom editor via the Save Settings button at the bottom.
The schematic will now automatically be used when starting a new game via the start menu or when using a game starter for quick game testing directly in a scene.
You can also use a Combatant Group instead of joining a combatant in the schematic. With this setup, you don’t need a Join Group node in the schematic.
For this, enable Set Start Group in the new game settings and select the combatant group you want to use.
Bonus: Adding a Spawn Point #
Adding a Spawn Point to your scene is pretty easy.
Use the scene hierarchy’s context menu: Makinom > Spawn Point
Or, the Makinom Scene Wizard: Create Object > Spawn Point
You can also manually add the Spawn Point component to a new, empty game object or an existing game object.
Spawn ID #
The most crucial thing of a spawn point is it’s Spawn ID. This’ll automatically be set up when adding a new spawn point.
Each Spawn ID should usually be unique to identify the individual spawn points. You can also share the same ID on multiple spawn points – this will randomly use one of them when using the spawn ID.
Place On Ground #
Use the spawn point’s Place On Ground settings to use a raycast to find the ground below the spawn point.
This helps to place whatever is spawned directly on the ground (by the spawn point being on the ground).