Developing interactions between players and game objects

John Canace
IMM at TCNJ Senior Showcase 2018
2 min readFeb 21, 2018

This week I created a feature that will inform players when a user object has been selected and ran into problems involving how to move those selected user objects in a server room. I created a new material for user objects for when selected with the left mouse button will change color from white to red. Allowing the user object to switch colors, I created an array containing the white user object material known as “Unselected_User” and the red user object material known as “Selected_User”. The array will be used for all user objects and will switch materials with the left mouse button.

These problems that I ran into involve figuring out how to teleport selected user objects on top of a player selected server room. Accomplishing this task without unintended features will require some restrictions. These restrictions are based on the game recognizing if there are user objects that are selected, if there is a server room that has been selected by the player and if that selected server room is not full.

Sever rooms being the black squares and the user objects are the white circles

Resolving these issues will require a new class file with some new methods. This new class file is called the GameManager and it house methods that other C# scripts and game objects can access. The GameManager will be used to identify when a user object is selected. Figuring out if a server room has been selected by a player will require the use of the OnMouseOver() which is a method that triggers when the mouse is hovering over a server room game object.

--

--