x


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, 2011 at 05:13 AM

brendna byers gravatar image

brendna byers
1 1 2 2

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

3 answers: sort voted first

Hello

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, 2011 at 06:01 AM

Noah 1 gravatar image

Noah 1
1.2k 121 93 108

(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, 2011 at 06:51 AM

Jason Hamilton gravatar image

Jason Hamilton
485 194 148 152

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, 2013 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, 2011 at 02:25 AM

slsberg gravatar image

slsberg
13 4 6 11

(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

By RSS:

Answers

Answers and Comments

Topics:

x2617

asked: Feb 28, 2011 at 05:13 AM

Seen: 2790 times

Last Updated: Feb 02, 2013 at 05:11 PM