SGD300 - week 7 Devlog


Introduction

The tasks for this week were to add an indicator for which character was selected on the screen and add some feedback for where the user clicked on the screen.

Goals

1. Add an image to the game to allow feedback on which character the user has clicked on.

2. Add an image to the mouse clicked movement layer in the player script to appear where the player clicked.

3. Animate that image a little to add a little movement to catch the users eye on the screen. 

Personnel

Primary - Nathaniel Hughes

Technologies, Tools, and Resources used

Provide resource information for team members who wish to learn additional information from this log.

* [Player Indicator tutorial](https://www.youtube.com/watch?v=OOkVADKo0IM)

*[Instantiate Unity Scripting](https://docs.unity3d.com/ScriptReference/Object.Instantiate.html)

Tasks Undertaken

1. Research different ways to add an image to unity and how to add it to different player when they have been clicked.

2. Research how to add an item to the game when clicked.

3. Research basic animation mainly how to have the image increase and decrease in size.

4. Add the Player indicator function to the player.

5. Add the Movement indicator to the player .

6. Animate the indicator to alternate between increasing and decreasing

What we found out

This week has bee a fusstrating struggle with Sourcetree merge conflicts, and scripting troubles. I found it hard to take video tutorials or examples on code and apply them to what i'm currently working on. This week I found a Youtube video that demonstartes examples of how to create and add an indicator to the currently selected Unit.

In the video he uses an empty game object with quad that is child to the game object to display the indicator, he graps a references to his Mouse Manager that he uses to switch player and sets the location of indicator to the renderer's bounds of the mesh that is attached to the currently selected player. This doesn't work well with layout of the code for the Dungeon Siege projetc we are working on.

With help from Keanu we worked on instantiating an object from the assets of the game to a position above the player. To do this we required two Serialized references and one private reference. The Serialized references belong to the Offset and the GameObject we were using(at the moment it is a black pawn). the private variable is a reference to the gameobject that will be held within the script.

There is a single method in the script that uses 2 if statments to check if the gameobject is true, that will create a new vector3 using the x, y, and z of the currently selected object to create a new location to instantiate the pawn. The pawn will follow the selected object and will change its location to a new object when it has been selected.

Solution Justification

Keanu and I Used this method to display the indicator because it is the most logical solution we could come up with. The only new feature is that we are Instantiating an object above the currently selected player instead of adding a new element to the editor that has to hold the indicator as was shown in the tutorial i found.  

Get SGD300

Leave a comment

Log in with itch.io to leave a comment.