How to use OnClick() with two functions in same script?

I have MoveRight() wired to my button when clicked my player moves right. I duplicated my button and changed it to left button. I go to change the OnClick() (Basket) to MoveLeft() but nothing shows up?

The function is public right?

public void MoveRight()
    {
       
        moveRight = true;
       
    }

    public void MoveLeft()
    {
       
        moveLeft = true;
       
    }

In situations like these, first thing I do is I simply cut and paste the functions so the bottom one is now on top. Then I would see if the existing, working link is still configured and then check if the other function now appears when I use the other button.

From your post it sounds like you are under the impression that you can only have one function visible per script. This is a good way to verify if you are correct or not.

First time I tried to attach functions to actions I couldn’t get any of my functions to show up. Finally I figured out I need to make delegates of type System.Action and call the delegates before they show up… then a while later I realised I was a complete idiot… My public functions appeared in the list but it was hidden in between the other available functions and all I had to do was open my eyes :stuck_out_tongue:

Per haps you are having a suitably blond moment as well…? So simple enough thing to try: replace the order of those two functions in the script and see if anything changes :slight_smile: