Thursday, February 12, 2015

Entry 006 - Feature Implementation: Electricity Induction

In order to be able to create an almost fully functional prototype I started working on the so called "Electricity Induction" feature. What it means is, that the player can induce electricity into a special type of hexagon that then reacts and does something. For now it goes up by a bit, waits and then goes down again.

So how does it work? It's basically like a switch that can be used from far away. Also after a few tests I decided to change it so that a simple click won't be enough. The longer you aim at the hexagon and the longer you hold left mouse, the higher the platform will rise.

Electricity Induction Feature in Action

As seen in the video, once you aim at the hexagon and are close enough, the center starts glowing indicating that the player can interact with it. If you then press left mouse a value will be increased (left side of the screen) depending how long the button is being held. The moment it's being released, the hexagon will rise depending on the value... or in short: the longer you hold left mouse, the higher the hexagon will go up. As a little neat extra I also added a light that is getting brighter to give feedback on how long the left mouse button has been held already.

Making the Feature work within a complex Blueprint.

For anyone of you who's interested in how this all works, the picture above displays the wip Blueprint. It features many complex parts such as a tracing function (is player looking at the object), a distance function (is he close enough), an actual action function (moving the component) and many many more. The comments are a mere reminder for bugs left to fix.

I hope you enjoyed this more in depth news item.

Greetings,
Dave

Edit: I have fixed both problems, "Broken if being looked away" by simply rearranging the order and adding a set electricity amount to 0. "Need check OR is in OverlapTrigger" has been way more complicated at first, though at the end a second check after it's not being looked at did the trick (is overlapping actor branch after looked at and before set visibility and being targeted).

No comments:

Post a Comment