How to Make a Basic First Person Horror Game in Unity (Part 5) - Unity C# Tutorial 2022

Channel:
Subscribers:
11,600
Published on ● Video Link: https://www.youtube.com/watch?v=RgqS1Udc7Ok



Category:
Tutorial
Duration: 10:31
5,457 views
93


This is part 5 to my 'How to Make a Basic First Person Horror Game in Unity' tutorial series.

#Unity #Unity3D #GameDevelopment

Be sure to like, comment, and subscribe if you want part 6 or just more Unity tutorials or videos from me in general. 👍

Door Script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Door : MonoBehaviour
{
public GameObject door_closed, door_opened, intText, lockedtext;
public AudioSource open, close;
public bool opened, locked;
public static bool keyfound;

void Start(){
keyfound = false;
}
void OnTriggerStay(Collider other){
if(other.CompareTag("MainCamera")){
if(opened == false){
if(locked == false){
intText.SetActive(true);
if(Input.GetKeyDown(KeyCode.E)){
door_closed.SetActive(false);
door_opened.SetActive(true);
intText.SetActive(false);
StartCoroutine(repeat());
opened = true;
}
}
if(locked == true){
lockedtext.SetActive(true);
}
}
}
}
void OnTriggerExit(Collider other){
if(other.CompareTag("MainCamera")){
intText.SetActive(false);
lockedtext.SetActive(false);
}
}
IEnumerator repeat(){
yield return new WaitForSeconds(4.0f);
opened = false;
door_closed.SetActive(true);
door_opened.SetActive(false);
close.Play();
}
void Update(){
if(keyfound == true){
locked = false;
}
}
}

Watch the first part here:
https://youtu.be/g2cEOHzMDBc

Watch the second part here:
https://youtu.be/YeV_7xKbFKA

Watch the third part here:
https://youtu.be/Z1PV5K_ueWM

Watch the fourth part here:
https://youtu.be/Yhyn6qUtITk

Follow me on Twitter:
https://twitter.com/omogonix

Try out my games:
https://omogonixlachlan.itch.io

Forgehub:
https://www.forgehub.com/members/omogonix.87700/

Subscribe to my Second Channel:
https://www.youtube.com/channel/UCkylkvUtpvbHfafGfIdMLBQ/featured

Join my Discord:
https://discord.gg/a88vmGD

Facebook Page:
https://www.facebook.com/Omogonix/




Other Videos By Omogonix


2022-03-25How to Randomize AI Destinations in Unity - Unity C# Tutorial 2022
2022-03-16How to Break Off Wooden Boards in Unity - Unity C# Tutorial 2022
2022-03-14Foreboding Tales Trailer
2022-03-11Simple Profile Generator Script in Python - Python Tutorial
2022-03-01Halo 5 Forge Map - Nightmare WW2
2022-02-28How to Add Videos Into Unity (Easy)
2022-02-27What Should We Expect in Halo Infinite Season 2?
2022-02-26Will Halo Infinite Get a Spartan Ops Mode?
2022-02-25How to Make a Basic First Person Horror Game in Unity (Part 6) - Unity C# Tutorial 2022
2022-02-24Halo 5 Forge Creations - Forerunner Punisher, Toy Mini Jeep, & Master Chief Pixel Art
2022-02-22How to Make a Basic First Person Horror Game in Unity (Part 5) - Unity C# Tutorial 2022
2022-02-21Will Halo Infinite Forge Be Too Difficult?
2022-02-18How to Make a Basic First Person Horror Game in Unity (Part 4) - Unity C# Tutorial 2022
2022-02-17Let's Talk About Halo Infinite Forge Once Again
2022-02-16How to Make a Basic First Person Horror Game in Unity (Part 3) - Unity C# Tutorial 2022
2022-02-15Halo - Alpha-Nine NEW LOOK, Rookie's Name REVEALED, NEW Squad Member
2022-02-14Halo 5 Forge Creations - Mini Elephant, Xbox Series X Replica, & Covenant Supercarrier
2022-02-12How to Make a Basic First Person Horror Game in Unity (Part 2) - Unity C# Tutorial 2022
2022-02-11How to Make a Basic First Person Horror Game in Unity (Part 1) - Unity C# Tutorial 2022
2022-02-091996 Chevy Tahoe in Halo 5
2022-02-08BANISHED Scarabs in Future Halo Infinite DLC?



Tags:
unity
unity tutorial
game development
how to make a game
unity 3d
omogonix
unity tutorial 3d
how to make a game in unity
how to make a horror game in unity
how to make a horror game
how to make a basic horror game in unity
how to make a basic horror game
c#
unity3d
part 5
unity c# tutorial
how to make a first person game in unity
unity tutorial 2022
tutorial
how to
horror game