I have my UIItems targeting my Player object and I am access a method called "MoveLeft on "On Down" and a method called "MoveLeftRelease"on "On Release".
Here is my code from my player script:
void Update ()
{
if (moveLeft)
{
transform.localPosition = new Vector3(transform.position.x + thePlayerSpeed * Time.deltaTime, transform.position.y, transform.position.z);
}
}
public void MoveLeft()
{
moveLeft = true;
}
public void MoveLeftRelease()
{
moveLeft = false;
}