Unity3D Tutorial – How to create a level, terrain and terrain texture

1 – Setup

Download Unity Hub on your operating system https://unity.com/

Install unity on your machine

In Projects, click create “new project”

Create project name

Choose location

And connect unity cloud if you want that

Once done, go next.

2 – Create terrain

            On Hierarchy (on the left by default)  > right click > 3D object > select plane

3 – Apply texture to plane (terrain)

Make a material
Select > Create > material
Rename it
In inspector > main Maps > albedo > assign a material
Click 3D model and assign material to him.

Tutorial Unity3D Third-person shooter (TPS) with Emerald AI 3.0 Melee AI Game Design Document (GDD) Compliance with 2022.3.5f1

Updating manually from the deprecated version generate errors (that I want to avoid).

Solution : beginning from nothing but the GDD.

import

  • Import ai (Emerald ai 3)
  • Import model (woman 01 with helmet – anaconda)
  • Import camera and controler (invector)

Configuration

  • Import project settings

Creation :

  • Folder “my project” on root
  • My melee combat (copy past from emerald ai)

Deletion

  • Main camera (Fly) (Position -3, 4, -20)

Creation again :

  • Invector > shooter > create shooter controller (select anaconda)

Configuration again :

  • Position (-3, 4, -20)

Insert :

  • Weapon from (not from prefab) : Hive > Shooter_Hive > ShooterFeatures > Inventory_Collectables (vCollectibleAssaultRifle with position z=-18)

The following : https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Invector-Integration-Tutorial

Configure : Tag and layer

  • In Inspector : tag “grenadier” must be defined as “enemy”
  • The hero: he should be a “Player” layer and a tag “player”. (vShooterController_Woman_01_With_Helmet_04)
  • In “detection and tags” > in tag faction options > in tag options > emerald unity tag: “Enemy” and “detection layers” select “player” and “enemy”. -> Now the grenadier can detect and try to attack the player.

Now the grenadier must be aggressive toward the player.

Setting up the player ‘s Shooter Manager

In “damage layers” > “damage layer” > select enemy

How to configure the name of grenadier ?

In ui setting , display ai name choose “yes”.

In ai setting stats : ai name: “Grenadier”.

Adding Player’s Bullet Collision Detection :

  • Script in asset/ invector 3D / shooter / prefab / weapon / bullet / vDefaultBullet prefab.
  • Go to Vprojectilecontrol
  • Go to Damage Options
  • Set damage value to any Number(like 10) (Previously it was 0).

How to configure vMeleeManager Code Snippet ?

In Assets/Invector-3rdPersonController/Melee Combat/script/melee weapon/vMeleeManager.cs.

Add script

Source : https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Invector-Integration-Tutorial

How to configure vProjectileControl Code Snippet ?

In asset > invector > script > weapon > vProjectileControl.cs

Add script

How to configure vExplosive Code Snippet ?

In vExplosive script , after colliders[i].gameObject.ApplyDamage(_damage, null);

Add script

How to configure EmeraldAIPlayerDamage Code Snippet ?

Add script

Tutorial Unity3D Third-person shooter (TPS) with Emerald AI 3.0 Game Design Document (GDD)

Create a new 3D project in Unity3D (not HDRP because it’s not supported by Emerald AI 3).

How to have Assets :

  1. To have Assets : https://assetstore.unity.com/
  2. Where is the « package manager » in unity ?
  3. Unity’s main menu and go to Window > Package Manager.

How to Import:

Warning: you must choose to use Emerald AI 3 to create a AI for this tutorial (it doesn’t work for another). Whereas, you are free to choose the player you wish and the TPS you want.

I have purchased Emerald AI 3.0, the female soldier 01 anaconda, and Invector Third Person Controller (TPS) – Shooter Template.

Next step is to buy AI and do the integration :

https://assetstore.unity.com/packages/tools/ai/emerald-ai-3-0-203904 (contain environment also)

  • You need also a player.

https://assetstore.unity.com/packages/3d/characters/humanoids/sci-fi/female-soldier-01-anaconda-248569

  • And a Third Person Shooter (a camera, a weapon(s) and ammos):

https://assetstore.unity.com/packages/tools/game-toolkits/invector-third-person-controller-shooter-template-84583

How to Create your project:

In Project > Assets >Emerald AI > Demo > Demo Scenes > Melee Combat Example

To copy-paste inside “my project” and renamed “my Melee Combat Example”. (dissociated from other assets folders to prevent an update to erase your files)

Since you copy-paste it, you don’t need to create an AI. It’s already done.

(How to Create an AI through the Setup Manager (Emerald AI wiki): https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Creating-an-AI-through-the-Setup-Manager )

Delete camera already existing because, you will create a new one by using Invector.

How to Configure (Player + Camera):

  • Invector (menu) > Import project settings
  • Invector > Shooter > Create Shooter Controller
  • Character creation window > fbx model > select
  • Choose the prefab/ asset (woman_01_with_helmet) with helmet
  • Inside vshooterController_woman_01_with_helmet , move 3D model where you want and copy paste the coordinate inside vshooterController_woman_01_with_helmet (Position: X = 0.9 ; Y = 3.5 ; Z = 0.6) (Rotation Y = 180) from closed space to open space.
  • After reset position 3D model
  • play
  • You don’t need the old camera(“Main Camera (Fly) ») , you can remove it. If error, you have a backup inside the (Emerald AI > Demo > Demo Scenes > Melee Combat Example)

Optional: ( How to Create a Companion AI with the Emerald AI Setup Manager)

  1. go to Window > Emerald AI > Setup Manager within Unity.
  2. In setup settings  > AI object : Woman_01_Without_Helmet_01 (Emerald Companion)
  3. And click the “save “ button at the end.
Companion ExampleAn example of a Companion AI that follows the player around. It will attack any opposing AI that tries to attack the player.

Tutorial How to perform Invector integration: https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Invector-Integration-Tutorial

How to Set up the AI Layer and Tags :

  • For the enemy: In inspector, the tag must be “enemy” and layer “enemy”.
  • The hero: he should be a “Player” layer and a tag “player”. (vShooterController_Woman_01_With_Helmet_04)
  • In “detection and tags” > in tag faction options > in tag options > emerald unity tag: “Enemy” and “detection layers” select “player” and “enemy”. -> Now the grenadier can detect and try to attack the player.

How to do add weapons and Ammo?

In Invector > Shooter > DemoScene

In hierarchy:    Hive > Shooter_Hive > ShooterFeatures > Inventory_Collectables

                                                – Ammo > vAmmoAssaultRifle_Inventory

– Weapons > vCollectibleAssaultRifle

Copy-paste on your project and change Transform to fit around your main player . (-1,0,0) and (0,0,-1)

The weapon should be a layer: “Triggers”.

How to activate the collision detection ?

I follow the source Tutorial : https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Invector-Integration-Tutorial

How to Set up the Shooter Manager (Important)

In Invector player (vShooterController_Woman_01_With_Helmet_01)  “Shooter manager” panel > in damage layers > select enemy.

How to configure vMeleeManager Code Snippet ?

In Assets/Invector-3rdPersonController/Melee Combat/script/melee weapon/vMeleeManager.cs.

Find the vMeleeManager script within your projects and open it. This code should be added right below the line onDamageHit.Invoke(hitInfo);

//Emerald AI Damageif (hitInfo.targetCollider.gameObject.GetComponent<EmeraldAI.EmeraldAISystem>()){                    hitInfo.targetCollider.gameObject.GetComponent<EmeraldAI.EmeraldAISystem>().Damage((int)hitInfo.attackObject.damage.damageValue, EmeraldAI.EmeraldAISystem.TargetType.Player, transform, 400);}

How to configure vProjectileControl Code Snippet ?

In asset > invector > script > weapon > vProjectileControl.cs

Find the vProjectileControl script within your projects and open it. This code should be added right below the first instance of onCastCollider.Invoke(hitInfo); and damage.damageValue = maxDamage;

//Emerald AI Damageif (hitInfo.collider.gameObject.GetComponent<EmeraldAI.EmeraldAISystem>() != null){                          hitInfo.collider.gameObject.GetComponent<EmeraldAI.EmeraldAISystem>().Damage((int)damage.damageValue, EmeraldAI.EmeraldAISystem.TargetType.Player);}

How to configure vExplosive Code Snippet ?

In vExplosive script , after colliders[i].gameObject.ApplyDamage(_damage, null); //Emerald AI Damageif (colliders[i].gameObject.GetComponent<EmeraldAI.EmeraldAISystem>() != null){                         colliders[i].gameObject.GetComponent<EmeraldAI.EmeraldAISystem>().Damage((int)damage.damageValue, EmeraldAI.EmeraldAISystem.TargetType.Player);}

How to configure EmeraldAIPlayerDamage Code Snippet ?

  1. in EmeraldAIPlayerDamage script, import script replacement DamageInvectorPlayer
  2. uncomment function DamageInvectorPlayer(int DamageAmount, Transform Target) ;

void DamageInvectorPlayer (int DamageAmount, Transform Target)        {            if (GetComponent<Invector.vCharacterController.vCharacter>())            {                //Applies damage to Invector and allows its melee weapons to block incoming Emerald AI damage.                if (GetComponent<Invector.vCharacterController.vMeleeCombatInput>().meleeManager != null)                {                    var PlayerInput = GetComponent<Invector.vCharacterController.vMeleeCombatInput>();                    var MeleeManager = GetComponent<Invector.vCharacterController.vMeleeCombatInput>().meleeManager;                     if (PlayerInput.isBlocking)                    {                        var _Damage = new Invector.vDamage(DamageAmount);                        var DamageReduction = MeleeManager != null ? MeleeManager.GetDefenseRate() : 0;                        if (DamageReduction > 0)                            _Damage.ReduceDamage(DamageReduction);                        MeleeManager.OnDefense();                        _Damage.reaction_id = MeleeManager.GetDefenseRecoilID();                        _Damage.sender = Target;                        _Damage.hitPosition = Target.position;                        GetComponent<Invector.vCharacterController.vCharacter>().TakeDamage(_Damage);                    }                    else                    {                        var _Damage = new Invector.vDamage(DamageAmount);                        _Damage.sender = Target;                        _Damage.hitPosition = Target.position;                        GetComponent<Invector.vCharacterController.vCharacter>().TakeDamage(_Damage);                    }                }                //If no Melee Manager is found, cause unreduced damage.                else                {                    var _Damage = new Invector.vDamage(DamageAmount);                    _Damage.sender = Target;                    _Damage.hitPosition = Target.position;                    GetComponent<Invector.vCharacterController.vCharacter>().TakeDamage(_Damage);                }             }        }

How to display name and Ennemy Health status bar ?

In AI Settings > Stat AI Name : AI Grenadier

In UI settings > UI Layer : Player

In UI settings > display name

In UI settings > enable health bar

How to add Bullet Collision Detection?

How to Damage on enemy (Grenadier):

Search for vDefaultBullet prefab

Go to Vprojectilecontrol

Go to Damage Options

Set damage value to any Number(like 10) (Previously it was 0).

Unity3D Invector and Emerald AI melee combat with player health bar

1. Create a SANDBOX (3D, NOT HDRP)

2. Add a demo scene with melee Emerald AI

3. Create a camera,

4. Add a player

5. Change layer to the same as enemy (water)

6. Test melee combat

  1. How to add weapons and Ammo ?

In Invector > Shooter > DemoScene

In hierarchy:   Hive > Shooter_Hive > ShooterFeatures > Inventory_Collectables

                                                – Ammo > vAmmoAssaultRifle_Inventory

– Weapons > vCollectibleAssaultRifle

The weapon should be a Triggers layer.

The hero should be a Player layer. (vShooterController_Woman_01_With_Helmet_04)

  • Collision detection or layer problem, or both ?

Follow tutorial :

https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Invector-Integration-Tutorial

  1. set enemy inspector to: tag enemy and layer enemy
  2. change tag option from respawn to enemy
  3. in player controller >

I have purchased Emerald AI 3.0 and Invector Third Person Controller – Shooter Template .

I try to follow a tutorial (https://github.com/Black-Horizon-Studios/Emerald-AI/wiki/Invector-Integration-Tutorial)

I don’t find the « Shooter Manager ». « This can be found on your Invector player. » it’s in vShooterController_Woman_01_With_Helmet_04 (scroll down)

  1. in asset > invector > script > weapon > vProjectileControl.cs
  2. in EmeraldAIPlayerDamage script, import script replacement DamageInvectorPlayer
  3. uncomment function DamageInvectorPlayer(int DamageAmount, Transform Target) ;

UNITY3D Moon Project (HDRP) Video Game Design Documentation (GDD)

Elevator Pitch :

The Product is a Free 2 Play (F2P) Third Person Shooter (TPS) Science Fiction 3D Video Game on the Moon that can be freely explored by the players.

Invest :

If not already done, I recommend to visit the Asset Store https://assetstore.unity.com/

Import:

            Environment : https://assetstore.unity.com/packages/3d/environments/sci-fi/sci-fi-moon-base-242575

  • Windows > Paquage manager > my assets > Scifi moon base > import
  • Scene > demo
  • If Pink > HDRP Wizard > project migration Quick links > convert all build in materials to HDRP

Controller : https://assetstore.unity.com/packages/tools/game-toolkits/invector-third-person-controller-shooter-template-84583

  • Windows > Paquage manager > my assets > invector third person controller – shooter
  • If Pink > HDRP Wizard > project migration Quick links > convert all build in materials to HDRP

Player : https://assetstore.unity.com/packages/3d/characters/humanoids/sci-fi/female-soldier-01-anaconda-248569

  • Import fbx model (HDRP) – female soldier 01(ANACONDA)
  • If Pink > HDRP Wizard > project migration Quick links > convert all build in materials to HDRP

Create:

  • Asset > create folder > copy paste demo environment and add what’s missing.

Configuration:

  • Invector (menu) > Import project settings
  • Invector > Shooter > Create Shooter Controller
  • Character creation window > fbx model > select
  • Choose the prefab/ asset (woman_01_with_helmet) with helmet
  • Inside vshooterController_woman_01_with_helmet , move 3D model where you want and copy paste the coordinate inside vshooterController_woman_01_with_helmet (Position: X = 0.9 ; Y = 3.5 ; Z = 0.6) (Rotation Y = 180) from closed space to open space.
  • After reset position 3D model
  • play

How to add weapons and Ammo ?

In Invector > Shooter > DemoScene

In hierarchy:   Hive > Shooter_Hive > ShooterFeatures > Inventory_Collectables

                                                – Ammo > vAmmoAssaultRifle_Inventory

– Weapons > vCollectibleAssaultRifle

How to pickup weapons and Ammo?

  • Copy paste from invector demo scene into “MyScenes” the weapon  (vCollectibleAssaultRifle).
  • Change weapon (vCollectibleAssaultRifle) position coordinates (-50 ; 48 ; 1.45)
  • Press E on it to pickup. Right Click to zoom and left click to shoot.

How to configure the project Settings :

            Author to define in application settings

            In Scene in build > Add myproject > Demo

            Resolution > Windowed

            Resizable windows > not checked

How to close the application properly :

            Press “I” for ‘Inventory’ and mouse is free

How to update the Unity 3D Editor?

  1. Select LTS Update
  2. Reimport Assets
  3. Convert all assets to HDRP with HDRP Wizard (can be long)

How to add Bullet Collision Detection and Health status bar ?

  1. Import assets :

ASSETS  > Invector > Melee Combat > simple melee AI > Prefabs > Enemies

  • EnemyAI_A, EnemyAI_B, EnemyAI_C, EnemyAI_D, BossAI
  1. Check rotation and position (rocks on the moon, not a perfect plane)
  2. Animation: Ragdoll physics when status bar to zero (fragged). The body hold the ground.

Unity3D Essentials Learning Pathway

Absolute Beginner Project Setup & Settings

  Install the Unity Editor for the first time

  Create and manage projects in the Unity Hub

Unity Editor Essentials

  Identify and use essential features of the Unity Editor.

  Create and Manage Scenes

  Navigate in 3D space in the Scene view

  Navigate in 2D space in the Scene view

Real-time Industry Essentials

  Understand Unity’s history and role within the industries that rely on real-time creation.

  Describe the real-time production cycle

Scene Building Essentials

  Identify the default elements in a new Scene

  Create GameObjects

  Manipulate GameObjects

  Work with components and Scripts

  Change the appearance of GameObjects

  Implement basic physics for GameObjects

Publishing

  Create and share a basic build

Absolute Beginner Job preparation

  Prepare yourself for the job search

  Create a portfolio, enabling you to pursue a job in real-time development

  Cultivate professional attitudes

  Plan your Unity learning journey by setting goals

  Practice continuous personal and professional growth

Source : https://www.credly.com/badges/baab2d5a-4ba7-4c2b-b2ea-c0af3046018d/public_url

Tutorial Unity3D Non-player character (NPC) Collision Detection with Player

Rigidbody for character : he fall throught

Physics > “box collider” for the player + “rigidbody” for the player

            Check the user is at the center of box collider (Y=1)

Each Environment: apply a meshcollider

Inspector > Box Collider to create (and size Y = 3.5 for Humanoid asset )

Source : https://docs.unity3d.com/Manual/CollidersOverview.html

https://alison.com/course/diploma-in-3d-game-development-with-unity-engine

Unity3d Tutorial: Integrate 3D Animations into a 3D Character into a 3D Scene

The short way:

  1. Download and Import “Basic Motion Free” from Kevin Iglesias. https://assetstore.unity.com/packages/3d/animations/basic-motions-free-154271
  1. Download and Import PBR model “ScifiGirl_Skin3” into the environment. (Character with no Animationcontrollers) https://assetstore.unity.com/packages/3d/characters/humanoids/sci-fi/scifigirl-gr-194758
  1. Drag and drop “Kevin Iglesias > Basic Motions > BasicMotions@Idle” into ScifiGirl_Skin3 “Animator > Controller”.
  1. Move the camera if needed; and press the ‘Play’ button.
Publié dans Jeux vidéo. Étiquettes : , , . Leave a Comment »

Tutorial Unity3D New York City (NYC) First Person Shooter (FPS) in High Definition (HD)

  • Import city builder – Physically based rendering (PBR)
  • Extract paquage in good format : URP City Builder Urban

https://assetstore.unity.com/packages/3d/environments/urban/city-builder-urban-180722

  • import fps
    • copy-past objects

https://assetstore.unity.com/packages/templates/fps-microgame-156015

  • change default camera (hierarchy -> Main Camera) (copy paste coordinate in inspector -> transformations)
  • check playability
  • position player : 23 ; -0,25 ; 2,9
  • rotation player : 0 ; -100 ; 0
  • check new weapon compliance with FPS Template
  • import new weapon (addons > MgFPS_Haku)

https://assetstore.unity.com/packages/3d/haku-fps-microgame-add-ons-197231

  • position weapon : 20 ; 0 ; 2
Publié dans Informatique, Jeux vidéo. Étiquettes : , , , , , . Leave a Comment »

How to make a First Person Shooter (FPS) Game in Unity3d for Free – Tutorial

Create a new project in unity3d.

How to have free Assets :

  1. To have Assets : https://assetstore.unity.com/
  2. Where is the « package manager » in unity ?
  3. Unity’s main menu and go to Window > Package Manager.

How to Import assets into Project:

How to configure properly:

  • In Geopipe > “pack01Demo” import All necessary objects from the FPS microgame (player and the others)
  • Select the scene. After, In Unity > file > BuildSettings > uncheck all the scene you don’t want” and check the correct one with “Add Open Scene” (interfaces linking to other scenes mainly)

How to position the Player in the environment :

  • In hierarchy > Click player.
  • In inspector > transform > Change position (50, 20, 8)
  • In inspector > transform > Change Rotation (0,0,0)

How to add an enemy:

  1. In hierarchy select create empty, rename “===== ENEMY =====”
  2. In project > FPS > Prefabs > Enemies
  3. “Drag and drop” one on the map
  4. Repeat “Drag and drop”  until satisfy of the number of enemies. (“All objectives completed” when all enemies dealt with)

Project : https://store.steampowered.com/app/1972230/Alcyone/