Touch Mechanic Like Rolling Sky

So, I’m trying to develop a game that has the same “gameplay movement” as Rolling Sky. I have read the Scripting API for classes related to movement and input. I still don’t know how to incorporate that sort of movement into my game.

I’ve also watched the tutorials,and searched on Google and YouTube for examples, but I couldn’t find anything related to my problem.

I’m new to “game development” but not new to "programming, so I’m pretty sure I’m just missing something small.

Put a sphere in the scene, put a rigidbody on the sphere, make a script that uses Input.GetAxis(“Horizontal”) and Input.GetAxis(“Vertical”) to create a Vector3 force, and apply that force to the ball’s rigidbody.

Now sprinkle a grid of cubes in for a given level, change their colors, make some triggers to sense completion, boom you’re off and running.

Now… iterate and profit!

I’ve got more questions now based on your answer:

  • What if my game was just a 2D top-down game? Would I just use Vector2 instead?
  • Is applying the force to rigidbody really it for making the rigidbody move like Rolling Sky’s ball?
  • I tested what I have with the WASD/arrow keys and the object that I have moves horizontally, but I how would I know if the code works on mobile phones since I’m not using any touch input to move the object horizontally during play test?
  1. Take a look at RigidBody2D and that whole 2D toolchain

  2. Force causes acceleration. Acceleration leads to motion. Damping damps out motion. IF you want to just move it, just translate it from point to point each frame.

  3. Take a look at the UnityStandard Assets pack: there’s some mobile controls in there for touch screen virtual joysticks.