Saturday, May 23, 2015

unityscript - Unity Input.GetMouseButtonDown(0) is not working


My code to detect left mouse click is not working Input.GetMouseButtonDown(0) and Input.GetMouseButtonUp(0). But same code for Input.GetMouseButton(0) is working.



Code:


void FixedUpdate()
{
#if UNITY_ANDROID
mouseWorldPos = Camera.main.ScreenToWorldPoint(Input.mousePosition + new Vector3(0, 0, 4f));
mouseCameraOffset = bowlingBall.position - mouseWorldPos;

if (Input.GetMouseButtonDown(0))
{
Debug.Log("last");

lastMousePos = Input.mousePosition;
}


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...