I set up the Drag and Drop Script with a camera at a 45 ° angle, in orthographic mode and I raised the camera.
I created the main Game Preface, with a Collider and the Drag and Drop Script inside (otherwise I could not move my Prefab)
I do not allow the prefab to move in Y. Only in X and Z.
I had to create a DrawRay in order to make my Préfab follow this DrawRay so that the Préfab can move in Z correctly
My Prefab is 45 degrees off the ground so it's facing my camera.
I have angles of 45 ° because I wanted to use the depth Z to put one image behind the other according to its Z position and having a 2D effect
When I drag my character to the left or right, I flip the Scale X (-1 or 1) according to the point 0 of my Préfab when clicked on it.
I created a small IDLE animation for this Prefab
A Random_Mouvement script was created to move the Prefab in the X and Z direction with random values
I created a horizontal Flip of my Préfab with function of the movement direction of my Préfab
I created Coroutines, so when I click on my Préfab, the Coroutine stops and the script Random_Mouvement is no longer active. All this reactivates when I drop the Préfab
0 comments