Friday 13th October 2023
Week 2
This week one of the programmer’s in the group was removed due to a lack of work, consistently being late and other reasons. As such I assigned myself to the mechanic he was supposed to be working on (the drag and drop).
We then had our idea presentation, I presented as I had worked on the slides and was the only one who wanted to. The other group members helped out by moving the slides forward. The presentation went well and the people watching seemed to be interested in the idea.
After our idea presentation we had a stand up meeting about what we had all done over the last week. The artist had made a very nice spaceman asset which needed no improvement. The other programmer had made some slight progress on the rooms mechanic however he was using code to do with mouse clicks in a game that would only ever be published on mobile. I then showed my work on the documentation.
Following the stand up I added several artwork tasks to the backlog including enemy art and backgrounds for the artist to “pick off” and assigned him to work his way through them. I then talked to the other programmer about his work and we agreed on how to improve it to the point were it could be used in the game.
As I said at the beginning the work I assigned myself to do this week is the drag and drop mechanic. There were many challenges for this as I have never used Unity’s new input system for touch input as such figuring it out took a lot of research and trial and error.
Once I had figured out how to tell if the user was pressing, holding down or letting go with a finger it was time to use these to drag and drop the character. This proved fairly difficult as while the sprite is 2D it is actually in the 3D world space as such I needed to convert the screen position to a world position, for a while I was confused as to why this was not working until I realised that the Z world position the game was giving me was a few meters behind the character. After changing the code to reflect this the character is now drag and droppable. (I also needed to tell it that the position it is dragging to should have the same Z position as the player or else the character flies off into the distance).
Here is a video of it working (the screen recorder also records the touch position for ease of viewing):