Here’s what I want: Simple UI buttons that work on mobile that guide the player between one of 3 positions. I have the positions set up as game objects, etc and can get it to work - BUT - the mouse registers OnClick as ther button RELEASES, not clicks DOWN, which doesn’t help me. When I try to change this with the Event Trigger and CrossPlatform input handlers, I get an This is not possible to be called for standalone input" error. What am I supposed to do exactly? And how do I reference the new Pointer Down event in my code?

EventTrigger (I believe) is used to override other scripts by connecting a gameobject to the EventSystem. Which is more complicated than you need for what appears to be just moving a start point left or right?
OnClick() is always if you mouse down and up on the same point. Other behaviors (Like Input.GetMouseButtonDown) can be utilized to solve your problem, and will have to be done with an actual script, not solely through the inspector window for a button component.
For reference: GetmouseButtonDown(0) is supposed to work on mobile platforms as “startclick” but I cannot personally confirm.
If all you are trying to do is move the start point arrow left or right depending on when you click left or right button, I could show an example code
1 Like
Yes, that would be great! All I want to do is move the player between the 3 points, only horizontal movements, using the Left and Right buttons…as SOON as the user touches the button. I’ve been at this for hours. It seems like the simplest thing, but I’m about to pull my hair out.
Okay so this should be attached as a component (in inspector) on whatever is being used to indicate where the player is.
so if its actually just an arrow, put it on that arrow. (if theres a parent object, on the parent)
if you have some sort of actual player object, put it on that
using UnityEngine;
public class playerMover : MonoBehaviour
{
public GameObject pos1; //In the Hierarchy Inspector , place a "empty" gameobject under your "One" space. so your "player" has somewhere to snap to
public GameObject pos2; //same as above for the secodn slot
public GameObject pos3; //still same same
void Start ()
{
//gameobject refers to the GameObject the script is attached to, transform is the positioning compenent seen in the Editor, and position is the actual values
gameObject.transform.position = pos2.transform.position;
}
public void moveLeft()
{
if (gameObject.transform.position == pos2.transform.position)
{
gameObject.transform.position = pos1.transform.position; //if at 2, move to 1
}
else if (gameObject.transform.position == pos3.transform.position)
{
gameObject.transform.position = pos2.transform.position; //if at 3, move to 2.
}
//if already at 1 do nothing
}
public void moveRight()
{
if (gameObject.transform.position == pos2.transform.position)
{
gameObject.transform.position = pos3.transform.position; //if at 2, move to 3
}
else if (gameObject.transform.position == pos1.transform.position)
{
gameObject.transform.position = pos2.transform.position; //if at 1, move to 2.
}
//if already at 3 do nothing
}
}
I’ll show what to put on your buttons in a second
1 Like
and this should go on your buttons.
any questions feel free to ask I’ll monitor hope it works as intended.
using UnityEngine;
using UnityEngine.EventSystems;
public class buttonOnPointerDown : MonoBehaviour
{ //trying to make things as readable as possible
public GameObject playerCONTROL; //Set your "Player" object to this in inspector. whatever has the playerMover Code attached to it in the inspector
public string Direction; //Simply Type in "Left" for the left button, and "Right" for the right. Caps matters.
public void onPointerDown(PointerEventData eventData)
{
Debug.Log(this.gameObject.name + " Was Clicked."); //to check if actually working. remove if it is
if (Direction == "Left")
{
playerCONTROL.GetComponent<playerMover>().moveLeft();
}
if (Direction == "Right")
{
playerCONTROL.GetComponent<playerMover>().moveRight();
}
}
}
When i try to add the script to my buttons, I get this error.

Also, the “Left” and “Right”…Are those referring to the actual button names?
I FORGOT SOMETHING important. and that is the actual USE of onPointerDown
just need to put , IPointerDownHandler after MonoBehavior
using UnityEngine;
using UnityEngine.EventSystems;
public class buttonOnPointerDown : MonoBehaviour, IPointerDownHandler //<<<<<<<<<<<<<<
{ //trying to make things as readable as possible
public GameObject playerCONTROL; //Set your "Player" object to this in inspector. whatever has the playerMover Code attached to it in the inspector
public string Direction; //Simply Type in "Left" for the left button, and "Right" for the right. Caps matters.
public void OnPointerDown(PointerEventData eventData) ///CAPS NOW <<<<<<<<< ON not on
{
Debug.Log(this.gameObject.name + " Was Clicked."); //to check if actually working. remove if it is
if (Direction == "Left")
{
playerCONTROL.GetComponent<playerMover>().moveLeft();
}
if (Direction == "Right")
{
playerCONTROL.GetComponent<playerMover>().moveRight();
}
}
}
Oh, nevermind…Forgot to change the class name.One moment.
That error means you are not using : MonoBehaviour. If you look at the beginning of the buttonOnPointerDown script, you will see the name of the script declared: then Monobehavior. that adds a reference to Monobehavior. I also for to reference IPointerDownHandler, which is the whole point of your question really
“Left” and “Right” check to see what you put in the inspector under string: Direction. You just have to type in Left for the left button, and Right for the right button.
It works! Thank you so much!! Is there any way to easily incorporate Vector3 into it so it smoothly shifts over?
1 Like
I think I may have that figured out…but if you have any tips… 
1 Like
No, in fact im struggling to remember what that is referred to while making my own help thread ATM.