This page lists a few 'recipes' that will teach you in a few steps how to do common tasks.

Introduction

Want to get started quickly with the Corgi Engine? This page contains simple steps you can follow for a number of basic situations, no explanations, just quick steps. Don’t hesitate to check the rest of the documentation to learn more about how the engine works! Note that most of these will provide Corgi Engine / Unity versions, that’s just to provide the context they were first written in. But it’s safe to assume that they should work on any higher versions of both Unity and Corgi Engine.

Creating a simple playable character and setting it in a scene

Creating a simple character :

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. open the MinimalLevel demo scene
  3. create an empty game object, position it at -10,-3,0, name it MyTestCharacter
  4. create a new empty child game object to the MyTestCharacter node, add a SpriteRenderer to it, set its Sprite to Adventurer_0, name it MyModel
  5. on the MyTestCharacter node, add a Character component, press the AutoBuildPlayerCharacter button at the bottom of it
  6. drag your MyModel into the Character’s inspector’s CharacterModel field
  7. edit the BoxCollider2D’s size to 0.8,0.8

Setting it as the playable character in our scene :

  1. drag the MyTestCharacter node into your project to make it a prefab, then remove it from the scene
  2. select the LevelManager, and drag your newly created prefab into its PlayerPrefabs[0] slot
  3. press play, enjoy your newly created character
  4. make sure you read the rest of the documentation to learn more about how to create more complex characters

How to import the Corgi Engine in your project?

  1. Create a new empty project using 2D or 3D as the Template
  2. Go to Window > Package Manager, then from the top left dropdown pick “My Assets”, find Corgi Engine in the list and import it the project (it has to be in an empty project, not an existing one)
  3. You will be warned that importing the Corgi Engine will overwrite your current project settings (that’s normal), click on Import.
  4. This will take a bit of time.
  5. Once this is complete, you’ll get a prompt saying “This Unity Package has Package Manager dependencies”. This is also normal, click on “Install/Upgrade”.
  6. After that you’ll get a list of the contents of the engine, don’t touch anything, and click on Import in the bottom right corner.
  7. Import will also take a while. Once import is complete, you’re ready to use the engine. Have fun!

How to import the Corgi Engine in a URP project?

The engine doesn’t do any rendering, it’ll work with any render pipeline.

The demos are made using the Standard Render Pipeline, as it’s still the only stable one, and the most common denominator, but you can use any RP you prefer. If you decide to use URP or HDRP in your project, the best approach would be to keep another project at hand, using SRP, to test the engine’s demos in, while you implement your own game in URP/HDRP.

Below are steps to install the Corgi Engine on a URP project. It’s recommended to have at least basic knowledge of render pipelines before picking URP or HDRP, considering the many quirks of these two render pipelines.

  1. Create a new project, using the URP template
  2. Import the Corgi Engine from the Package Manager
  3. Via the package manager, update other packages if you have to (Pixel Perfect typically can cause issues with URP on some of its versions)
  4. Open the MinimalLevel demo scene (or any scene)
  5. Open your project settings (Edit > Project Settings), in Graphics, at the top of it, set a Scriptable render pipeline asset (the URP default template usually comes with a few, pick the HighQuality one)
  6. In the scene, select the UICamera, on its Camera component, set RenderType to Overlay
  7. Select the MainCamera (called Regular Camera in some scenes), at the bottom of its Camera component, add the UICamera to its Stack
  8. If you want to convert all (or most) materials to URP, simply go to Edit > Render Pipeline > Universal Render Pipeline > Upgrade Project Materials to URP Materials, press play, the demo will play. Note that you’d also have to port post processing effects, as Unity went with a different system (volumes) on URP/HDRP.

Some of my materials are all pink!

While most of the materials used in the engine’s demos will display fine on all RPs, a few demos, like the NewCorgi3D one, use custom shaders, and these will break in HDRP or URP. Thankfully, you can convert them fairly easily, like so :

  1. select all materials that are using a BiRP shader (typically, the materials under Demos/Corgi3D/Materials)
  2. in their inspector, at the top, set their shader to Standard
  3. then, go Edit > Rendering > Materials > Convert Selected Built-In Materials to URP They won’t look just as good as they would have in BiRP, but will let you enjoy the demo just fine.

Adding a repositionable mobile joystick in place of the regular one

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. open the demo located at CorgiEngine/ThirdParty/MoreMountains/MMTools/Tools/MMControls/Demo, select its JoystickRepositionable node, copy it
  3. open the MinimalLevel demo scene
  4. open its UICamera prefab
  5. paste the repositionable joystick under Canvas and next to the existing Joystick node
  6. position it at 400,-1000
  7. disable it
  8. in its MMTouchRepositionableJoystick’s inspector, drag the UICamera node into its JoystickValue slot. Select the InputManager.SetMovement method (the one at the top, under DynamicVector2, NOT the static one)
  9. drag the UICamera into its TargetCamera slot
  10. select the UICamera’s top level, and drag the JoystickRepositionable node into the GUIManager’s inspector’s Joystick slot
  11. save your prefab, exit prefab mode
  12. select your UICamera, and on the InputManager inspector, set ForcedMode to Mobile, and MovementControl to Joystick
  13. press play, enjoy your repositionable joystick

Creating a jumper moving platform

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. open the FeaturesPlatforms demo scene
  3. drag a MovingPlatform prefab in the scene, at -72,-2,0
  4. create an empty game object, nest it under it, call it Jumper
  5. add a jumper script to it, set its JumpPlatformBoost to 5
  6. add a BoxCollider2D, set it to trigger, and its size to 5,1
  7. press play, enjoy

Creating a ladder

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. open the MinimalLevel demo scene
  3. create a new empty game object, call it “TestLadder”
  4. add a sprite renderer to it, in its sprite slot select blocks_25
  5. add a box collider 2D to it, set it to trigger, change its size to 0.3, 5
  6. change the object’s layer to Ladders
  7. add a Ladder script to it
  8. press play, you’ve got a ladder
  9. you can go further by adding a ladder platform to it, you can see how it’s done in the Minimal’s Ladder prefab

Creating a moving platform

  1. Start by dragging a sprite in your scene, or a 3D model
  2. Select your newly created game object, and set its layer to “MovingPlatforms”
  3. Add a non trigger BoxCollider2D to it
  4. Add a Rigidbody2D component to it, set its BodyType to Kinematic
  5. Add a MovingPlatform component to your object.
  6. You’re done! All that’s left to do is tweaking the MovingPlatform’s component’s inspector, typically you’ll want to start by adding a few entries in its PathElements list, which determines the points the platform will move through

Setting up an enemy so that it respawns after the Player character dies

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. open the MinimalLevel demo scene
  3. drag a Bear3D prefab into the scene, position it at -11,-4,0
  4. drag a Urchin prefab into the scene, position it at 5,-2,0
  5. select the Bear3D, add a AutoRespawn component to it
  6. press play, jump on the bear to kill it, then move right and jump on the urchin to die
  7. after the respawn delay, the player respawns, and so does the bear

Adding a checkpoint to a scene

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. open the RetroAI demo scene
  3. create a new empty GameObject, name it MyCheckpoint, position it at -63,-5,0
  4. add a BoxCollider2D to it, set its size to 1,10, isTrigger:true, and add a Checkpoint component to it
  5. press play, walk right under the red platform, go through the checkpoint and die on the spikes, you’ll respawn at the checkpoint

Setting up an existing DamageOnTouch area on a melee weapon

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. open RetroAI demo scene
  3. open RetroComboSword prefab, remove the 2 last MeleeWeapon components and the ComboWeapon component
  4. create a new empty child to it, name it MyDamage, add a box collider2D to it, isTrigger:true, add a DamageOnTouch component, TargetLayerMask:Enemies
  5. on the top level, set MeleeDamageAreaMode:Existing, and drag MyDamage into the ExistingDamageArea slot
  6. press play, grab and equip the sword next to you, press E to attack, notice the damage area you bound gets activated when attacking

Starting a level with weapons pre-added to an inventory

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. open the FeaturesWeapons demo scene
  3. select the RectangleWithInventory prefab in your project view
  4. under CharacterInventory, set the AutoAddItemsMainInventory array size to 1, drag the InventoryMachineGun asset into the Item slot, set quantity to 1
  5. Drag the InventoryGrenadeLauncher asset into the AutoEquipWeapon slot
  6. press play, you now start with the grenade launcher equipped. Press T to switch to the machine gun, press T again to revert to the grenade launcher

Adding a level to RetroAdventure

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. duplicate RetroAdventure3, name it RetroAdventure6
  3. add that newly created scene to the build settings
  4. open RetroAdventureLevelSelection, under the Content node, duplicate the RetroAdventureLevel5 node, change its ItemTitle’s text to “Level6”, on its RetroAdventureLevel comp, change scene name to “RetroAdventure6”
  5. on the RetroAdventureProgressManager (in that scene and on the prefab), add a 6th scene, set its name to “RetroAdventure6”
  6. press play, go through the levels
  7. at the end of lvl 5 you get redirected to the level selection (that’s normal, we didn’t change the exit scene in that level)
  8. play level 6, collect some stars in it, return to level selection, enjoy your newly collected stars

Using the new Input System in other scenes

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. from the package manager, install the latest version of the Input System package
  3. open the MinimalLevel_InputSystem demo scene
  4. copy the UICamera_InputSystem node
  5. open the Lava demo scene
  6. paste your node in the hierarchy panel
  7. remove the UICamera node
  8. press play, you’re now using the new input system

Setting up simple rooms

Setting up a first room

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. open the MinimalLevel demo scene
  3. create a new empty game object, name it Room1, position it at -9.5,0,0
  4. add a BoxCollider2D to it, set its size to 20,11, then add a Room component to it, set its layer to IgnoreRaycast
  5. add an empty child object to it, name it Confiner, add a CompositeCollider2D to it, geometry type: polygons, then copy and paste the Room’s BoxCollider2D on its child, and check UsedByComposite on it, on the Rigidbody set Body Type to static
  6. add another child to Room1, name it VCam, add a CinemachineVirtualCamera to it, and a CinemachineCameraController to it, uncheck ConfineCameraToLevelBounds on it
  7. on the CinemachineVirtualCamera, set ortho size to 3, and Body to Framing Transposer, then add a CinemachineConfiner (Add extension dropdown at the bottom of the virtual camera’s inspector), in Confine Mode : Confine2D, and drag the Confiner object into its BoundingShape2D slot
  8. on the Room1 object, drag the VCam object into the Virtual Camera slot and the CinemachineCameraConfiner slots
  9. open a new inspector for the Confiner object, lock it, and drag the BoxCollider2D from that inspector into the Room’s Confiner slot

Creating a second room

  1. select Room1, duplicate it, name it Room2, position it at 10.5,0,0
  2. on Room2’s vCam, set its CinemachineVirtualCamera’s Priority to 0
  3. select the left wall of the MinimalLevel (named “Platform100x1000 (6)”), duplicate it, move it to 0,0,0 to create a wall between the 2 rooms

Linking both rooms with teleporters

  1. create a new empty child under Room1, name it Teleporter1, add a SpriteRenderer to it, set its Sprite to AchievementIcons_6 (a simple yellow circle)
  2. set its layer to Default
  3. position it at 8,-4,0, add a BoxCollider2D to it, isTrigger:true, add a Teleporter component to it
  4. under the Rooms foldout, set CameraMode:CinemachinePriority
  5. duplicate the Teleporter object, name it Teleporter2, parent it to Room2, position it at -9,-4,0, change its SpriteRenderer color to black
  6. on Teleporter1, under the Destination foldout, drag Teleporter2 into the Destination slot
  7. still on Teleporter1, under the Rooms foldout, drag Room1 into the CurrentRoom slot, and Room2 under TargetRoom
  8. on Teleporter2, under the Destination foldout, drag Teleporter1 into the Destination slot
  9. still on Teleporter1, under the Rooms foldout, drag Room2 into the CurrentRoom slot, and Room1 under TargetRoom
  10. press play, move right, once you connect with the yellow teleporter press space to get to the other room

Setting up simple Cinemachine Zones

  1. In this example we’ll work in MinimalCinemachineZones, and for that we’ll disable all existing CinemachineZones. Feel free to adapt sizes and positions to your own context.
  2. Create a new empty gameobject, name it MyZone, position it at -71,-2.5,0
  3. Add a BoxCollider2D to it, set its size to 31,11.5
  4. Add a CorgiCinemachineZone component to it
  5. Create an empty child object, name it VirtualCamera
  6. Find a virtual camera you like. We’ll use the one under MinimalCameraRig, right click on the CinemachineVirtualCamera component, copy component, and then “paste component as new” on our empty VirtualCamera object
  7. At the MyZone level, drag the new VirtualCamera into the VirtualCamera slot. As this is our first zone in our level, we’ll also check CameraStartsActive. We want the Player to activate this zone, so we’ll select the Player layer in the Trigger Mask dropdown, and we’ll check SetupConfinerOnStart to let the engine handle all the complex confiner setup.
  8. Press play, your camera will now be confined to that zone.
  9. Exit play mode, and duplicate MyZone into a new MySecondZone object. Move it to -40,-2.5,0
  10. Notice at the bottom of the inspector you can change the zone’s gizmo color, pick one you like
  11. Select the second zone’s virtual camera, and under Lens, set the OrthoSize to 3
  12. Press play, move right, you’ll transition to the new zone, with a more zoomed in camera
  13. You can now add more zones to cover your whole level, position them however you like
  14. If you want to tweak camera transitions between zones, that’ll be on the CinemachineBrain on your camera (in this case the Regular Camera object under MinimalCameraRig). You’ll want to change the DefaultBlend and its associated duration.

Setting up points of entry to go to a specifc point in another scene

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager**
  2. duplicate the MinimalLevel demo scene twice, name the new scenes SceneA and SceneB
  3. add them to your build settings (edit > build settings, then drag both SceneA and SceneB into the “scenes in build” panel)
  4. open SceneB, add a new, empty game object at 0,-3,0, name it Entry0, add another at 15,-3,0, name it Entry1
  5. select the LevelManager, and add both Entry0 and Entry1 to its PointsOfEntry list, save the scene, make sure you set the DebugSpawn to null
  6. in SceneA, create a new sprite, set its sprite to AchievementsIcons_6 (or any sprite of your choice), position it at -5,-4,0
  7. add a BoxCollider2D to it, isTrigger:true
  8. add a GoToLevelEntryPoint component to it, under ActivationConditions, set AutoActivation:true, under Finish Level, set LevelName to SceneB, save the scene
  9. press play, walk right to collide with the sprite, sceneB will load and you’ll spawn where you positioned the first entry point
  10. exit play mode, select your GoToLevelEntryPoint, set PointsOfEntryIndex to 1, press play, walk to it, sceneB will load and you’ll spawn where you positioned the second entry point

Creating a simple playable character with 3D models

Whether your model is a sprite, a Spine character, voxels, a 3D model, or more, character creation is always done the same way. Here are simple steps to create a 3D character :

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. open the MinimalLevel demo scene
  3. create an empty game object, position it at -10,-3,0, name it MyTestCharacter
  4. create a new empty child game object to the MyTestCharacter node, name it ModelContainer
  5. nest a Cube under ModelContainer at 0,0,0, nest a Sphere at 0.5,0.5,0 (that’ll be our head)
  6. on the MyTestCharacter node, add a Character component, press the AutoBuildPlayerCharacter button at the bottom of it
  7. drag your ModelContainer into the Character’s inspector’s CharacterModel field
  8. drag the MyTestCharacter node into your project to make it a prefab, then remove it from the scene
  9. select the LevelManager, and drag your newly created prefab into its PlayerPrefabs[0] slot
  10. press play, enjoy your newly created character

Creating a very simple AI character

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. open the MinimalLevel demo scene
  3. from the project panel, drag a Platform1000x100 prefab into the scene, position it at 0,-1,0
  4. create an empty game object, position it at 0,0,0, name it MyTestCharacter
  5. create a new empty child game object to the MyTestCharacter node, add a SpriteRenderer to it, set its Sprite to Adventurer_0, name it MyModel
  6. on the MyTestCharacter node, add a Character component, press the AutoBuild AI Character button at the bottom of it
  7. drag your MyModel into the Character’s inspector’s CharacterModel field
  8. edit the BoxCollider2D’s size to 0.8,0.8
  9. on the AI’s AIWalk component, check AvoidFalling:true
  10. press play

Creating a very simple melee weapon

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. open the MinimalLevel demo scene
  3. create a new, empty game object, name it MyNewMeleeWeapon, add a MeleeWeapon component to it
  4. drag this object into a folder in your project to make a prefab out of it, remove it from the scene
  5. select the Rectangle prefab, drag the MyNewMeleeWeapon prefab into its InitialWeapon slot
  6. press play, press E to attack (we didn’t setup any animation or visuals, so you’ll have to select your weapon’s damage area to see it activate)

Creating a very simple projectile weapon

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. open the MinimalLevel demo scene
  3. create an empty game object, name it MyTestProjectileWeapon, position it at 0,0,0
  4. add a ProjectileWeapon component to it
  5. add a MMSimpleObjectPooler to it , set its GameObjectToPool to the MinimalMachineGunBullet prefab
  6. optionally add a WeaponAim component to it
  7. drag the MyTestProjectileWeapon in a folder in your project to make a prefab of it, remove it from your scene
  8. select the Rectangle prefab, set the MyTestProjectileWeapon prefab as its InitialWeapon
  9. press play in the editor, then E to shoot

Using the CharacterDetector

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. open the MinimalLevel demo scene
  3. create an empty object, name it Detector, position it at -5,0,0
  4. add a box collider 2D to it, set its size to 2,10, set IsTrigger:true
  5. press play, walk to the right, when the character gets into the area, CharacterInArea turns true
  6. feel free to trigger Unity events via the slots in the inspector

How to setup a character for slope orientation

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. open the MinimalSlopes demo scene
  3. open the NewCorgi3D prefab, create an empty game object inside it, position it at 0,-0.4,0, name it RotationNode, and parent the SquashAndStretch node to it, without changing its position
  4. save your prefab, return to the MinimalSlopes scene, and drag the NewCorgi3D prefab into the LevelManager’s PlayerPrefabs[0] slot
  5. press play

Adding and setting up a Damage Dash ability

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. open the MinimalLevel demo scene
  3. drag a MinimalShootingRangeTarget prefab in the scene, position it at -6,-4,0
  4. edit the Rectangle prefab
  5. add an empty child object to it, name it MyDamage, set its layer to Player, position it at 0,0,0
  6. add a box collider 2D to it, set it to IsTrigger:true
  7. press the AddComponent button, look for DamageOnTouch, add it
  8. on its TargetLayerMask, check Enemies
  9. on the top level object (Character), remove the CharacterDash ability
  10. add a CharacterDamageDash ability
  11. drag the MyDamage node into its TargetDamageOnTouch slot
  12. set InvincibleWhileDashing to true
  13. save your prefab, press play, press F to dash into the target

Setting up a feedback on a melee weapon

  1. in this example we want to associate a feedback to the action of hitting a wall (or any non damageable element) with a weapon
  2. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  3. open RetroAI
  4. edit the RetroComboSword prefab
  5. add an empty child, name it WeaponHitWallsFeedback, add a MMFeedbacks to it
  6. add a Debug>Log feedback to it, set its DebugMessage to “test”
  7. on the 1st MeleeWeapon of the RetroComboSword, drag the WeaponHitWallsFeedback into the WeaponOnHitNonDamageableFeedback slot
  8. save the prefab
  9. press play, grab the sword, hit the wall on the left (with E)

Setting up damage on touch

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. open the MinimalLevel demo scene
  3. create a new sprite, set its SpriteRenderer’s Sprite to Adventurer_0, position it at -8,-4.5,0
  4. add a BoxCollider2D to it, isTrigger:true
  5. add a DamageOnTouch component to it, set its TargetLayerMask to Player
  6. press play, walk towards the sprite, you’ll get knocked back when colliding with it

Recreating a RetroAdventure-like progress

Creating new scenes

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. duplicate the MinimalLevel, name it Progress1
  3. open it
  4. select the RetroAdventureProgressManager prefab, change its 5 scene names to Progress1, Progress2, Progress3, Progress4 and Progress5
  5. drag the prefab in your scene
  6. drag a RetroAdventureLevelEnd prefab in your scene, position it at -4,-4.35,0
  7. change its FinishLevel/LevelName to Progress2
  8. select the ButtonLevelSelection’s Background, set its LevelSelector’s Level Name to RetroAdventureLevelSelection
  9. remove the UICamera from the scene, drag a RetroAdventureUICamera into it instead
  10. disable its InventoryCanvas child
  11. save the scene
  12. duplicate it, rename the copies Progress2, Progress3, Progress4 and Progress5
  13. open them each to edit their RetroAdventureLevelEnd and change the destination scenes to n+1, have Progress5’s be RetroAdventureLevelSelection
  14. add all 5 levels to the build settings (file > build settings > drag and drop your new scenes in the list)

Creating a new level selection scene

  1. duplicate the RetroAdventureLevelSelection scene, name it ProgressLevelSelection
  2. for each of the buttons (at the RetroAdventureLevel component level), change the Scene Names to Progress1, 2 etc
  3. save the scene
  4. add it to the build settings

Testing

  1. click the “Tools > More Mountains > Reset all progress” menu item
  2. press play, notice all levels are locked except level 1
  3. click on level 1’s play button
  4. in Progress1, move right to touch the level’s exit
  5. click on the “next level” button
  6. in Progress2, move right to touch the level’s exit
  7. click on the “next level” button
  8. in Progress3, press escape, then Back to level selection
  9. notice all 3 first levels are unlocked

Setting up a HealthBar

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager
  2. open the RetroAI demo scene, drag a RetroCrate prefab into it, position it at -20,-2,0, set its Health’s Initial and Maximum Health to 300
  3. add a MMHealthBar component to it, set its SortingLayerName to Above
  4. press play, walk right to grab the rifle, press T to equip it,then shoot at the crate, and you’ll notice its healthbar update as it loses health

Setting up separate collision for movement and damage (hitbox)

  1. open the Rectangle prefab
  2. add a child object to your character, name it SeparateHealth, add a box collider 2D to it, tweak its size/position to your liking, isTrigger:true
  3. copy (don’t cut) the RigidBody2D from the top level to SeparateHealth
  4. copy the Health from the top level, paste it to SeparateHealth, remove it from the top level
  5. on SeparateHealth’s Health component, drag the top level of your character into its AssociatedCharacter slot
  6. drag SeparateHealth into the Character’s CharacterHealth slot
  7. save your prefab

Setting up multiplayer inventories

  1. in Unity 6000.0.23f1 (or higher), create a new project and import Corgi Engine v9.1 via the Package Manager, open the FeaturesInventory demo scene
  2. edit the RectangleWithInventory prefab, add a InventoryCharacterIdentifier to it
  3. duplicate MainInventory, name it MainInventory, set its PlayerID to Player2
  4. duplicate the UICamera’s InputManager, set its PlayerID to Player2
  5. drag a RectangleWithInventory prefab into the scene at -70,-5,0, set its Character.PlayerID to Player2, set its CharacterInventory.PlayerID to Player2, Main Inventory Name to MainInventory, set its InventoryCharacterIdentifier’s PlayerID to Player2
  6. press play in the editor, move right with Player2 (using arrows, N to jump) pick up the chicken, notice it goes into P2’s inventory. Move right with Player1 (WASD), pick up the teddy bear, notice it goes into Player1’s inventory. Note that for the sake of brevity, these steps don’t take into account weapon inventories, but the logic would be the same.