The Function don’t work on my RawImage Object
void OnMouseOver()
{
Debug.LogError(gameObject.name);
}
I tried everything I saw on the forum but I don’t know why nothing work :s
Here my object:

I tried with that component :

and with the 2d components too but I can’t find why nothing work…
Thanks.
2 Answers
2
Try to make your script implementing the IPointerEnterHandler interface :
public class MyClass : MonoBehaviour, IPointerEnterHandler
{
private void OnPointerEnter(EventSystems.PointerEventData eventData)
{
Debug.LogError(gameObject.name);
}
}
If you read the manual, (here) the OnMouseOver also has a special setting for GUI elements, which you are using. Since the Canvas is in the UI layer, I reccomend you don’t try to use colliders 
Yes, Thank You. What I actually want to do is, rotate an object on the local axes. as you mentioned, I used " transform.Rotate(0,180,0);" I also want to move it forward. But for that I cant use local axes, because the axes are constantly rotating and the object won't neatly move forward on the same local axes. Hence I want to know how to move them on the global axes. Do you know, how to move on global axes? Thanks in advance.
– rugvedkhandekar