A Coin Distraction

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.

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.

--

--

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