In this tutorial we’ll handle some initial settings.
We start with some basic setup for 3D games, our game controls and some other small settings.
We’ll set up:
- a few 3D related settings
- player group settings (faction, size)
- game controls
- input keys
- sound types
Let’s get to it!
3D Setup and more #
First, we’ll handle some settings for our 3D game – it’s pretty simple, we need to prioritize 3D raycasting (or limit it completely to 3D) and set the default horizontal plane to use a 3D setup. This is the default setup in a new project, so we mainly take a look at it, in case you want to do 2D, this is something that you need to change.
Most of our setup will be done in the Makinom editor, you can open it via Unity’s menu: Window > Gaming Is Love > Makinom
Or: Window > Gaming Is Love > ORK Framework (same editor as Makinom)
You can also open the editor using a keyboard shortcut: CTRL + ALT + M (Windows) or CMD + ALT + M (Mac)
You’ll find the main sections of the editor at the top of the editor window. The sub-sections of the selected main section are displayed at the left side of the editor window.
The tutorials will often ask you to navigate somewhere, which is in the style of MainSection > SubSection, e.g. you now need to navigate to the main section Game and it’s sub-section Game Settings.
Navigate to Game > Game Settings and change the following settings.
Base Settings #
- Default Horizontal Plane
Select XZ.
Use this for 3D games. - Default Raycast Type
Select First 3D or Only 3D.
Using First 3D will check with 3D raycasting first and fall back to 2D raycasting if nothing was hit, use it in case you’re mixing 3D and 2D physics in your game.
Using Only 3D will only check with 3D raycasting.
Both are fine for our setup (though we only use 3D physics).
As their names suggest, these are the Default settings – everything that uses them has also options to overrule them with a custom setup, but you’ll usually not need that unless you have some special cases where you switch perspective or change between 2D and 3D.
ORK Game Settings > Player/Group Settings #
We also need to select the player’s faction and set the battle group size to 2.
- Default Faction
Select Player. - Battle Group Size
Set to 2.
ORK Game Settings > Game Over Settings #
Since we’re already here, let’s check out what happens on game over (we don’t need to change the default setup, though).
The game over settings let you e.g. load a special game over scene, show a choice dialogue (e.g. load game) and more. The default setup will simply load the start menu scene (which we’ll define later in UI > Start Menu).
We’ll stick with the default setup, which shouldn’t show a choice and load the start menu instead:
- Show Choice
Disable this setting. - Load Start Menu Scene
Enable this setting.
Game Controls #
We’ll use ORK’s built-in Button controls and the Top Down Border camera. A fresh project setup already comes with some default input keys (e.g. WASD movement keys) set up for us, so we just need to use them in our controls. You can learn more about game controls in ORK in this documentation.
Navigate to Base/Control > Game Controls.
ORK Control Settings > Player Controls #
We’ll use the Button controls – this is the default setup, we just need to select the input keys we’re using.
The Button player controller moves the player using a Character Controller component – the tutorial assets are already set up that way. When working on your own projects or using different prefabs/models, keep in mind that you’ll need a Character Controller if you want to use the Button player control. You can also use different ways to move the player, this is handled by the Move Type setting.
- Vertical Axis
Select Vertical Move. - Horizontal Axis
Select Horizontal Move.
ORK Control Settings > Camera Controls #
We’ll use the Top Down Border camera – this camera control can be used in both 2D and 3D games (handling is based on the horizontal plane we just set up).
This camera control can also use Camera Border components in the scene to limit the viewing area for the camera, more on that in the next tutorial.
- Camera Control Type
Select Top Down Border. - Child Object
Select Path.
We’ll define a path to a child object. - Find Child
Set to: Head
This is a child object on our player combatants (or rather, every combatant’s prefab).
Instead of the camera being pointed at the player’s position, it’ll look at the head, giving a better camera placement.
Rotation Settings #
We’ll allow rotating the camera using the mouse.
- Use Rotation In
Select Both.
We can rotate the camera in the field and in battle (when camera control is allowed). - Remember Rotation
Enable this setting.
This’ll keep the camera’s rotation when changing scenes.
We’ll use the Mouse/Touch Controls.
- Input Type
Select Both.
We’ll alove mouse and touch control. - Mouse Button
Set to 1.
Uses the right mouse button. - Finger Count
Set to 2.
Uses 2 fingers. - Click Count
Set to 1.
Uses 1 click/touch inputs, e.g. set to 2 for double click/touch to initiate the rotation. - Mode
Select Move.
The rotation is used when moving the cursor/fingers.
Input Keys #
The input keys define the inputs the player can use. We’ll change the Accept input key to use Space instead of Return and also add a new input key to call our menu (which we’ll set up later).
You can learn more about input keys in this Makinom documentation.
Navigate to Base/Control > Input Keys and select the Accept input key.
2: Accept #
This input key is set up in a default project and used to accept UI selections and interact with the game world. We’ll change the used keyboard key.
Input ID Setting 0 #
- Positive Key
Select Space.
Have trouble finding it in the long ist of available keys?
Try using the search feature of the popup selections!
6: Menu #
Add a new input key using the Add button above the list of available input keys.
Change the following settings of the newly added input key.
Content Information #
These settings define the content (name, description, icon, etc.) of the input key (or whatever data you set up, e.g. items, combatants, etc.).
- Name
Set to: Menu
Input ID Setting 0 #
- Input Origin
Select Key Code. - Positive Key
Select F1. - Input Handling
Select Down.
The input is recognized only the moment the key is pressed down, i.e. not while continuing to hold it.
Sound Types #
Sound types are used to bind audio clips to a defined type and assign them to combatants or game objects. We’ll use them to play attack, hit and death sound effects without worrying about what sound is actually played, as that’s up to the sound assignments of the combatants.
Navigate to Base/Control > Sound Types, we’ll set up 3 of them (including the already added Default one).
0: Attack #
- Name
Set to: Attack
1: Hit #
- Name
Set to: Hit
2: Death #
- Name
Set to: Death
Save Changes #
That’s it for now, time to do a first save in our project.
Changes in the editor are not automatically saved, you have to actively do that by clicking on the Save Settings button at the bottom of the editor.
Since this is the first time saving, there’s quite a lot of changes listed, since all data is new.
Tip!
Saving in the editor can automatically create a backup of the previous data. This is a time consuming process – I’d recommend to disable Create Backup for now and only use this option from time to time (e.g. once a day) to create backups willingly.
Next, we’ll set up our player and spawn it.