A Coin Distraction

Coin Drop

Like any good stealth game, you need some sort of distraction system. This is exactly that. So how does it work?

The idea is when the player presses the right mouse button, Darren “throws” a coin at said location and the guards hear it and get distracted allowing him to sneak through.

Left: Player Method on throwing the coin. Right: Action (Method) that is called on the Guards

The left picture is on the Player script. It uses the same system of Raycasting as how the player moves. Based on where the player clicks it Instantiates an Object at that location, playing a sound, animation and broadcasting an Action to the Guards to move to that location. The Action that was set up, is sending a Vector3 and Bool to the guards to notify them that the coin was indeed tossed and at what location. It then sets their destination to that position and they all run over there distracted.

With this, that’s another part of the project down. Next setting up the cameras.




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

Recommended from Medium

Rigel Protocol February Updates

{UPDATE} Toddler Learning Game-EduKitty Hack Free Resources Generator

On cyber-attacks, supply chains, and Simone Biles

Russia’s Pact with the Devil

{UPDATE} Moon Race Hack Free Resources Generator

Planning privacy and data protection programs — a how-to

Test Your Seed Backup: Dry-Run Recovery

How to root Haier i619

Root LG Phone

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
Brennen Witzens

Brennen Witzens

More from Medium

Adding a Bar in the HUD for Thrusters

Moving Platform and Lives

Learn to code by making a 2D space shooter game.

2D Mobile Game: Simple Parallax