For this week I will be keeping my focus on the android controls as too much of my attention is going towards my learning outcomes, just an update on my learning outcomes, I have finished two of my learning outcomes which are mesh deformation and persistent score in a side project meant for my external learning outcomes.
While working on the android controls I watched a tutorial to understand how unity’s event system works as I have not worked with it before , it seems to be simple enough although I made a few human errors while coding the OnPointerdown method visual studio prompted me to fix an error which I miskicked and it added the code “throw new System.NotImplementedException(); ” which made the errors go away although it was not something I understood & it was not meant to be there, rather it was supposed to take in the pointer event data which is shown in the screenshot below. The following gets the event data of the joystick being pressed when the pointer is pressed down , in my case I am taking in the same information as on drag ,

The on drag function takes in event data from the mouse which in the code below is pointerEventData , the code here moves an image as a joystick which can be seen in the screenshot below. The code in the OnDragfunction is used to detect in which direction the mouse is being moved and this is a value between -1 -0-1
In the code it detects the position of the image to determine whether or not it has moved & how much it can move .
As we could not fix the problem on our own, we consult our facilitator after a few minutes of troubleshooting the problem we noticed that the animators software had the wrong forwards set & the models themselves were rotated too which was read by unity as 0,0,0 when it was 90,0,0 . After we set the x,y,z to vector3.zero it seemed to work and we did not face any problems .
While integrating our project , it took us a few hours longer than expected due to the models but we are confident that we will be able to show progress for our project this semester .
Another thing we discovered this week was that the models we got did not have the same z axis as the other models in unity had, this could not be fixed by rotating the object as a lot of the code would already be rotating the object, luckily our animator was in the day we found out which also happened to be the day we were integrating everything which gave us ample time to fix the problem with our animator. After a few tries of fixing the problem we could not solve the problem which made the z axis look in the y direction, this can be seen in the image below.
Comments
Post a Comment