I Need a simple cube to move randomly

Taking the advice of others and creating a very simple game that involves the user attempting to click a cube that moves along a plane randomly. Problem is I can’t find any resources on how to get a cube to move on it’s own along a plane randomly. The cube moves on it’s own within the parameters of the plane and the object is to click it. I’d like to achieve this so I can learn the basics of rigidbody and simple ai. If I can get started with random movement, I can grow from there playing with code. Any help is help, thanks!

One way to do this could be to define the max distance that the cube can travel to on each axes, then have it move to a random point using MoveTowards(Unity - Scripting API: Vector3.MoveTowards) and Random.Range (Unity - Scripting API: Random.Range), while constantly scanning if your cube is moving. When it’s not, a new destination is redefined and cube is ordered to move towards it.

If the plane parameters are very important to you, you could always scan for whatever plane you want to use when the game begins and take max range directly from it.

That’s a good start! Thanks for the info. The plane has walls, I’m figuring I can script it so the if the cube hits the wall it changes direction. I think that way I won’t have to program the size of the plane.