Need to move player(cube) using ui button on screen

Hello guys.
I am new to unity and visual scripting.
I have knowledge on 3d modelling, animation etc…
But the problem is I watched all basic tutorials on" how to move an object(player) when I touch ui button(or ui image) on screen". But I didn’t find simple tutorial.
My main issue is: I know to create ui image(left arrow and right arrow on screen) and I know to create cube(player). And I have added component on player input. I m using new input system. When I touch a ui image the player is not moving.
Where to connect the ui image to player in unity?
Can anyone type and give me a simple steps so that it works.
Thanks a lot in advance.

I know it’s not what you ask for, but consider learning regular C# scripting. Why? Because it gives you an extra skill that will be universal in any programming. Don’t worry it’s not so hard!

Back to the question.

  • Write CubeController script with methods Left, Right (for start).
  • Drag and drop the script on the Cube game object.
  • Make left and right UI buttons on the screen.
  • Look inside UI buttons components something like “on click”, press + sign, drag and drop the Cube into spot “None (Object)”. Now you have a reference to the object.
  • From the list in the same place look for “CubeController”, and the next menu Left or Right method you wrote.

But before you do that you probably need some background on how to move objects at all (link at the beginning).