press button down in Unity 4.6

Hi Everyone here,

I’m trying to move my player to the left or right using UI Buttons with a touchscreen
but when I use the ‘on Click()’ event trigger I have to release the button and press it again to make the player move.
I tried the ‘PointerDown’ event trigger but it doesn’t work either.

this is the part of code i use to move the player left or right:

	public void RightButton()
	{
		MyTransform.Translate(Vector3.right * playerSpeed * Time.deltaTime);
	}

	public void LeftButton()
	{
		MyTransform.Translate(Vector3.left * playerSpeed * Time.deltaTime);
	}

Try this video: Unity Platformer Tutorial - Part 2 - Touch Input Buttons - YouTube :smiley:

Maybe this Video Tutorial will help you out: Unity Platformer Tutorial - Part 1 - Basic Movement - YouTube

Thank you guys!