I want to make a 2nd high down scene with 3d Objects. I might make a 3D scene and simply tilt the digital camera 45 levels on X and that may give me principally the identical factor(I believe). However I began with a 2nd mission and slowly it turned 2.5D and it was time to exchange the flat 2nd pictures with high down pixel artwork. However making pixel artwork takes time, so I made a decision to make use of 3D Objects as a substitute. I acquired it to work however I do not know why I had to make use of these particular values. Nor can I discover any sources on how that is often achieved.
The best way I made it work was to Rotate the Participant Object by 56.06f on X, 0 on Y and angle – 90 on Z. That is the entire code:
var mouseInWorldSpace = Digicam.most important.ScreenToWorldPoint(Enter.mousePosition);
var dir = (mouseInWorldSpace - rework.place);
var angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;
rework.rotation = Quaternion.Euler(45f, 0, angle - 90);
And I additionally needed to rotate the kid visible object by -90 on X. However why?
Right here is the ultimate end result https://imgur.com/a/5OahMuS
Rotating in 2.5D with a 3D Object in a 2D scene is bizarre. If the view was high view then you definitely would solely have to rotate on the Z axis. You would not have to the touch the opposite axis nor would it’s important to contact the kid visible object.
The issue right here is that its a 2nd scene, which suggests the character can solely transfer on x and y. The Digicam should not rotate in any respect. It should not be so complicated. If it was a standard 3D scene then you definitely would solely tilt the digital camera 45 on x and you’d be accomplished. The character would transfer on X and Z. The one distinction right here is that its X and Y, and never X and Z.
However for some purpose I simply do not perceive how you can make it work in a 2nd scene. Why did I’ve to rotate X to -90 on the kid visible after which one other 45 on the dad and mom x. And for some purpose I could not mix them. If I made the mum or dad use -45 then it breaks. And the Z have to make use of angle – 90. May somebody assist me or level me to a rotation/Vector/Quaternion supply so I can study why this labored.