Stealth Game: Sleeping Guard Interaction

Today, I implemented the ability for the player to trigger a cutscene when near the sleeping guard!

It turned out to be quite nerve-racking! The sequences of game objects on the cutscene had to be edited, in a way, that made it difficult.

But alas, I have relentlessly defeated this problem, and I have learned along the way! Such things that make it difficult are always the best way to learn!

The timeline is still new to me. I am grateful to be in a position where I am learning all of these things I have wanted for such a long time.

So down to the nitty-gritty, I have a trigger collider set around the sleeping guard’s desk.

I created a script that when the player enters the trigger, it will activate the cutscene game object in the OnTriggerEnter() function.

using UnityEngine;

public class GrabKeyCardTrigger : MonoBehaviour
{
[SerializeField] private GameObject _keyCardCutscene = null;

private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
_keyCardCutscene.SetActive(true);
}
}
}

A short and simple script.

This was the easy part! Editing the cutscene in the timeline kicked my ass. I made it work in the end. It looks like this:

I have learned a lot using the timeline for this project! It’s something every Unity developer needs to know!

I am all set to make future cutscenes for my games. I so eager to make them, but I must be patient!

This project is almost to an end, and I hope there will be more cutscene creations in the coming courses!

That is all for today. Thank you for your time!

Gabriel

--

--

--

Hello everyone, My name is Gabriel Perez, I am a Unity Developer and a creator who is always learning and experimenting.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

NO-CODE with Serverless Action — Node-RED and Openwhisk

Using Git Hash for Software Versioning

Creativity in Custom Web Design Begins on the Back End

ArgumentCaptor in practice

Unity Game Dev Learn By Doing

How I prepared and passed AZ-204

AZ-204 badge

How To Configure a Static IP for Your Serverless App

Blue static electricity

Using a Professional Interface

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Gabriel Perez

Gabriel Perez

Hello everyone, My name is Gabriel Perez, I am a Unity Developer and a creator who is always learning and experimenting.

More from Medium

2.5D Cert Req: Creating A Ledge Grab

Unity Profiler- Game Dev Series 144

Cinemachine and Group Targets in Unity

Unity Interface Layout