The next step in this weeks design document is to implement unit interaction. Right now the 1st step is to have a stationary enemy unit that a player controlled unit will detect and not bump into.
0 Comments
The first milestone was a resounding success. I completed the task of getting the unit to detect a tile and then move toward that tile. The movement was based on 6 numpad keys; since the grid is a hexagon. Using an invisible cube that is a child of the parent object, anything that collides with the child, automatically gets registered with the Parent's collide script. When a num key is pressed the unit rotates in that direction, along with the feeler. If it detects the tile's hitbox, tagged as "Center" it will then start a co-routine which switches off a bool which then allows the MoveToward command to activate. Since the MoveToward command needs a transform position, I grab it within the collision event by telling the game to grab the transform of the object it just collided with. After it starts moving, the feeler box is turned off so it does not keep going once it detects another tile. Then the sensor turns back on and the movement is shut off after a second.
Video Documentation This Blog is a place to post the development of my work in progress games and other projects.
My current project is working on the basic mechanics for a digital tabletop game called "Ancients and Arms" in Unity. It teaches the battle tactics of ancient Persian and Greek warfare. This game will be used by history teachers in my local school district. My first goal is to implement a way for units on a board to detect other objects. This will be done by adding invisible cubes whose collides will act a sensors that detect the collides of other tile spaces. |