GetCurrentMousePosition GetCurrentMousePosition().GetValueOrDefault();
private Vector3? GetCurrentMousePosition()
{
var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
var plane = new Plane(Vector3.forward, Vector3.zero);
float rayDistance;
if (plane.Raycast(ray, out rayDistance))
{
return ray.GetPoint(rayDistance);
}
return null;
}
https://www.youtube.com/watch?v=o9RK6O2kOKo
https://i.imgur.com/LXbUxzn.png
https://www.reddit.com/r/Unity3D/comments/nh0hn8/satisfactory_conveyor_belts_made_with_unity/
https://stackoverflow.com/questions/72927883/why-is-unity-compressing-my-button-image-so-much
- create an empty GameObject
- make the empty GameObject the child of ObjectX
- reset the Transform of the empty GameObject (it should now center ObjectX)
- unparent the empty GameObject
- rotate the empty GameObject so that it's axis are the way you'd like them to be on ObjectX
- make the empty GameObject the parent of ObjectX