How to make an object move?

I can't get the object to move when i press the arrow keys. how can i make the object move around, controled by the arrow keys?

more ▼

asked Feb 28 '11 at 05:13 AM

brendna byers gravatar image

brendna byers
1 1 1 1

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first


Well you need to create a script for that and add some gui textures for the arrows. I dont know how much knowledge you have in unity but if youre new I really reccomend you reading the Unity scripting introduction.

Good Luck

more ▼

answered Feb 28 '11 at 06:01 AM

Noah 1 gravatar image

Noah 1
1.2k 42 47 53

(comments are locked)
10|3000 characters needed characters left

Hey, I recommend looking up the TornadoTwins on Youtube, that how I learnt. :P

more ▼

answered Feb 28 '11 at 06:51 AM

Jason Hamilton gravatar image

Jason Hamilton
470 70 74 80

on TornadoTwins second video in the worm game the scripting for moving wont work. i'm getting this error and p.s. i'm very new to this

Assets/Move.js(14,31): BCE0005: Unknown identifier: 'forward'.

and here is my scripting

var speed = 3.0; var rotateSpeed = 3.0;

function Update(){ var controller : CharacterController = GetComponent(CharacterController);

//rotate around y-axis
transform.Rotate(0, Input.GetAxis ("horizontal")* rotateSpeed, 0);

//move forward / backwards
var forwards= transform.TransformDirection(Vector3.forward);
var curSpeed = speed * Input.GetAxis("Vertical");
controller.SimpleMove(forward * curSpeed);}

@script RequireComponent(CharacterController)

Feb 02 '13 at 05:09 PM harryman1324
(comments are locked)
10|3000 characters needed characters left

var playerSpeed : int;

function Update () {

amtToMove = (playerSpeed * Input.GetAxis("Horizontal"))*Time.deltaTime;

transform.Translate(Vector3.right*amtToMove); }

don,t forget to set playerspeed in inspector hope this helps

more ▼

answered Mar 10 '11 at 02:25 AM

slsberg gravatar image

13 2 3 6

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



asked: Feb 28 '11 at 05:13 AM

Seen: 2367 times

Last Updated: Feb 02 '13 at 05:11 PM