HELP ME PLEASE TO FIX MY PROBLEM..

Help… how to use if statement in ui buttons… inside of private void update…
Im trying to make a ui buttons inside of the if statement… but is always show in the console edit - projects settings - inputmanage blahblah… but i already made my own function when i hit the button… in the void start i create some onclick listener and when the player hit the button i made my function to and that’s is void pickUpdown and placeDown. or there’s even wrong with GetButtonDown?

If you dont understand… try my other question.

I made my ui buttons and my platform is android. This is what i want when the raycast hit in certain distance… then the ui buttons can do his function that i made and that’s is (void pickUpDown) and (void placeDown) and how do i do that with if statement. I already add some onClick and add listener in void start.
So i hope you understand sorry…

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class rayCastCSHARP : MonoBehaviour
{

public GameObject _parent;
public GameObject _testObj;
public GameObject _parent1;
public Button pickUp;
public Button place;

void Start () {

	pickUp.onClick.AddListener(pickUpDown);
	place.onClick.AddListener(placeDown);

}

private void Update()
{
	var fwd = transform.TransformDirection(Vector3.forward);
	var hit = new RaycastHit();
	if (Physics.Raycast(transform.position, fwd, out hit))
	{
		if (hit.distance <= 1 && hit.collider.gameObject.tag == "pickup")
		{
			if(Input.GetButtonDown("pickUp")) {
				
				pickUpDown();

			}
		}
	}
	if (Input.GetKeyDown("space"))
	{
		_testObj.transform.parent = _parent1.transform;
		print("please lord");
	}
}

void pickUpDown () {

}

void placeDown () {

}

}

You should be creating your buttons in the OnGUI() method…?

void OnGUI() {

if (GUI.Button (new Rect (0, 0, 200, 50), "Pickup")) { //creates a button and listens for it to be clicked.
pickup(); //once clicked.
}

if (GUI.Button (new Rect (0, 50, 200, 50), "Drop")) { //creates a button and listens for it to be clicked.
drop(); //once clicked.
}

}

Using the OnGUI() method is basically the same as using the void Update() function, except it handles the User Interface.

You can make calls to different functions within the script from there, and you can use the OnGUI() with mobile devices.

I hope I have understood what you are trying to do.