Hi, I was wondering how I could move objects on the x,y,z axis in my game. Like when you select a object a 3 arrows will appear to show t x,y,z axis same with rotation it but only with rings around it. If you could help me I would appreciate it a lot.
this should be easy enough.
1st you would want to make your UI element you could do this simply as a world canvas or … well you have loads of options so I will leave that to you for now.
2nd you want to handel the on click so you know when the object is selected. If this is a 3D object which I assume it is you will need 2 things for this to work.
1 = A collider on the object
2 = A Physics Ray Caster on the camera
https://docs.unity3d.com/Packages/com.unity.ugui@1.0/api/UnityEngine.EventSystems.PhysicsRaycaster.html
Doing that you can now use the MonoBehaviour’s mouse events much like you would with a UI object e.g. Unity - Scripting API: MonoBehaviour.OnMouseEnter()
You would use that to show or hide your UI element as noted above …
So for example you migh thave the UI element be hiden by default and to show when mouse over, then you can use the UI element to know which action the player wants to perform e.g. if they mouse down on the up arrow aka Y axis element then they want to transform on the y and you can apply the mouse Y deleta on the selected objects Y axis.
I don’t understand it completely Cause I’m new to unity. I got to the adding the collider and the physics ray caster. But how do I add the on mouse enter on the ui? Cause it needs a renderer to work amd the ui doesn’t have a renderer a mesh. I’ve tried putting the script on the ui button and then adding my mesh from the object to it but it does not work. The only way I’ve found it to work is by adding the on mouse look script to the game object itself is that what you meant?