[4.6] GUI Button OnRelease?

Hey community,

in my current Android app made in Unity 4.6 I use the new Gui System. The new Button has its On Click() event which is working fine. But if the player is releasing the button the main charakter just walks endless further.

I tried to use the WaitForSecounds() methode to reset the button in a way, but it isnt working.
This is my code so far:

using UnityEngine;
using System.Collections;

public class UIcontroller : MonoBehaviour 
{
	public bool pressedD = false;
	public bool pressedU = false;

	
	IEnumerator Wait(){
		yield return new WaitForSeconds (3.0f);
	}

	public void ButtonDOWNpresser() //Called from the OnClick() section of the GUI button
	{
		pressed1 = true;
		StartCoroutine(Wait());
		pressed1 = false;

	}

	public void ButtonUPpresser()
	{
		pressedU = true;
	        StartCoroutine(Wait());
		pressedU = false;
	}
}

Is there no On Release() section to the On Click() section for the GUI button?

Thank you very much for your help!

Add an Event Trigger component to your button (In the event menu). From there you can add a listener for OnPointerUp. Treat it just the same as OnClick.

Note: It actually sounds like you want an OnPointerDown instead of OnClick. A click is defined as a button going down and then being released on the same element. So typically OnClick and OnPointerUp will be called in the same frame.