select and move with keyboard

Hi, new to unity5, it’s fun to follow tutorials on youtube and such. But I need to find out how i make this possible.

I want to be able to click on a GameObject lets say a box. When it’s clicked should i be able to move this object Up or Down “one-unit per press”
The cube is 1x1x1 so when i press UP will it go up y:1. And y:-1 when i press down

I don’t know where i should find my answer :slight_smile: Hope you can help me

  1. you need to cast a ray from the mouse position to the world
  2. get the ray hit with the gameobject that you want to control
  3. tell your movement script that now any movement should be applied to the gameobject found in the hit;

this involves :

  1. a movement/control script;
  2. a mouse pick script that handles if you clicked over a gameobject that can be controlled;

You can use the numeric keypad to press and hold the active mouse button and to release it. This is helpful if you want to drag an item. Point to the location where you want to move the item and then press the decimal point (.)

MaryKayInTouch