Hi again guys.
I’ve stumbled a bit in the code and I’ve had over 8 hours of trying to get this today but I couldn’t get to the end of it. I’ve searched all over and found similar questions but none offered me a good response honestly.
I want to click on an object and while holding the click to know if my mouse is moving up, down, left or right so that afterwards I could perform actions based on these 4 directions.
I’ve tried to debug it like this, but it doesn’t quite get me there. Any help would be greatly appreciated (even a link towards a question that has been answered if this is a dupe):
function Update()
{
if(Input.GetMouseButtonDown(0))
{
OnMouseDrag();
}
}
function OnMouseDrag(){
if(Input.GetAxis("Mouse X") > 0)
{
Debug.Log("X e mai mare ca 0");
}
if(Input.GetAxis("Mouse X") < 0)
{
Debug.Log("X mai mic ca 0");
}
if(Input.GetAxis("Mouse Y") > 0)
{
Debug.Log("y mare ca 0");
}
if(Input.GetAxis("Mouse Y") < 0)
{
Debug.Log("y mic ca 0");
}
}