The complete RPG Engine for Unity
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 > Main 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:
Open the Makinom editor and navigate to Schematics. Create a new schematic, there is no additional setup needed in the Settings.
Add Node > Group > Group > Join Group
First, we’ll add a combatant to the player group.
If you want to add multiple combatants to the player group, just add multiple Join Group nodes, each adding the combatant you want.
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.
And that’s it for the schematic. Click on Save Schematic to save it, e.g. as StartGame.
To use the schematic to join your player and spawn it, you can either set it up as the Start Schematic in UI > Main 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 > Main Menu in the Makinom editor and change the following settings.
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 main 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.
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.
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.
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).
© 2015 Gaming is Love e.U.
Disclosure: This site may contain affiliate links, which means I may receive a commission if you click a link and purchase something that I have recommended. While clicking these links won’t cost you any money, they will help me fund my development projects while recommending great assets!