Home > other >  The unity of how to implement parallel to drag and drop a plane
The unity of how to implement parallel to drag and drop a plane

Time:09-27


As shown in figure, want to realize the click of a mouse drag objects along the direction parallel to the ground,
Online to find the code runs parallel to the screen is the face of the movement, this object will float in drag
Reason is that online methods are object to the camera distance z is changeless, cause how objects move won't be far away from the screen, not what I want effect,

Y interval of the screen and objects to the screen as if also is not proportional to the distance z, although to a smaller coefficient is almost parallel to the ground, but not precise enough, brother maths is bad, want to broken head also don't know how to the whole,
Please tell everyone a great god,

CodePudding user response:

While using trigonometric function can really work out but I feel that I also pray for UNITY should be have their own way

CodePudding user response:

reference 1st floor qq_22400179 response:
although can really work out by trigonometric function, but I feel that I also pray for UNITY should be have their own solutions

Yes, though he could write, but should be have a good way to feel the unity so commonly used functions,,,

CodePudding user response:

Click send rays from the camera, when testing your plane collision, mobile access point

CodePudding user response:

You must put the mouse coordinates (screen coordinates) is converted into a 3 d world coordinates, then x or y % grid width is set to figure

CodePudding user response:

Please learn from Camera ScreenToWorldPoint method
  • Related