Hi, help me solve one problem. The task is as follows.
I have a circle on which the sphere moves in any direction, on the border of the circle (i.e. the radius from the center) is a cube that moves strictly along the border, always keeping the radius (the y vector is fixed). The task is to throw the sphere off the plane, and the cube must prevent this. There is another unresolved issue:
The side of the cube should always face the center, but quaternions in Uniti do not allow rotation by more than 180 degrees, i.e., they can be transformed.LookAtThe (vector 3. null) method also doesn’t solve my problem.
- put all points in an array
- check which point is on the floor and closest to the destination
- rotate based on that point (probably parent the cube to the an empty GameObject at that point)
- back to 2.
Add an empty gameobject to the middle of the circle, attach the cube to it and just rotate it