SGD300 - week 6 Devlog


Introduction

I began week 6 by troubleshooting the problem with the interaction cursor when it hovered over the interactable items. The cursor would flicker back and forth between the mamin cursor and interaction for a short period of time before stopping on the correct cursor.

Goals

1. Fix the cursor bug on the interactable item.

Personnel

Primary - Nathaniel Hughes

Technologies, Tools, and Resources used

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

* [Cursor](https://docs.unity3d.com/ScriptReference/Cursor.html)

*[Text Implementation method](https://www.youtube.com/watch?v=5BobLzmqhNE&t=384s)

*[Tootip scripting](https://docs.unity3d.com/ScriptReference/TooltipAttribute.html)

*[camera scripting](https://docs.unity3d.com/ScriptReference/Camera.WorldToScreenPoint.html)

Tasks Undertaken

1. Debug the input script to try and fix the cursor problem

2. research different methods of displaying a Text on the screen

3. Implement chosen method into the appropriate script

4. troubleshoot any problems

What we found out

At the end of class during week 5, I discovered that the interaction cursor had a small bug where it would flicker between the main cursor and the interaction cursor while hovering over an iteractable item for a small period of time before settling on the corrct interaction cursor. The cause of this problem has remained unidentified but has seemed to have sloved itself, somehow over the weekend.

The next task i undertook was finding a wat to display a text of the item name at the location of the item. The first method was implemented in the Input Script but I couldn't figure out how to set the location of the text to the object that the name displayed. The second attempt I made was to remove the text from the input script and place it into the pickup script. 

This method used a Text attached to the canvas that was a child of the item. This methid used OnMouseOver and OnMouseExit to allow the text to display the name that was faded above the item at the location of the gameobject. This method was better than the first because it removed the text dependencies from the input script and placed them into the pickup script. This mehtod is very performace intensive because having multiple canvases takes up alot of resources.

To fix this I created a new script called UiManager, that would handle the UI elements of the game. In this script I have several methods that will display the name of the item using a single canvas and text element. This script links to the player inputs and allow the location of the item and the name to be called using the raycast update. 

Solution Justification

The solution for this weeks task was important because, it is important to learn how to isolate dependencies from each other. Removing the implementation of the text UI element to a script that handles methods for the UI, gives a location for future task to be completed without having to add code to another script where it doesn't belong. 

Get SGD300

Leave a comment

Log in with itch.io to leave a comment.