Pagina's

Sunday, 24 February 2019

I'm on the outside

A new <Russian accent>great success</Russian accent> in my game. I managed to have animations to control and I have a system that knows and shows whether the player enters or leaves a location. It took me an evening and a morning, but now it works.

First I needed to get a grip on how animations work. I saw a couple of videos about making doors open and close, but they all had a little problem in that they focusses on the door itself and I wanted to have the pivot of the door control it open, so I didn't need to move the door, just rotate the pivot. That worked fine, but I got to have a lot of work in the animator component, because the door could not close after being opened, immediately slammed shut after opening or it kept repeating the animations (the health system luckily did not react to being smashed between the door). Now I found out how to fix that.

Second is a generic inside/outside trigger system that I'm certainly going to use a lot in the future. There's a box collider that the player needs to go through to get to a location (just past the door, on the side of a village etc.). It notices if the player passes it and if it's relevant to act on it. If theplayer is outside the building and passes the Outside-trigger, it does nothing, but if it gets inside and passes the inside trigger, a boolean value will change and understand that passing the outside trigger will mean something else.

Here it is in action:

No comments:

Post a Comment