x


Javascript for Character Controller

Im new to unity and i'm not sure how to make my character move in a certain way with js: i want my character to continue to go forwards, backwards, left, or right when each key is pressed. In other words, when the left key is pressed, the character will keep a steady speed going to the left. Can anyone help me write this in javascript?

more ▼

asked Dec 07 '11 at 09:56 AM

Casey Webster gravatar image

Casey Webster
1 5 5 7

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

2 answers: sort voted first

Hey! I would recommend checking some of these things out to get you started!:

SimpleMove
transform.Translate
input.GetButton

more ▼

answered Dec 08 '11 at 01:50 AM

KyleHickman gravatar image

KyleHickman
66 2 2 3

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

There is a ton of documentation on this.

Check out the UnifyWiki, where you will find a bunch of example character controller scripts.

more ▼

answered Dec 08 '11 at 03:08 AM

jahroy gravatar image

jahroy
3.2k 14 18 41

Wow this even helped me out! :D Thanks!

Dec 08 '11 at 06:51 AM KyleHickman
(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:

x3459
x202

asked: Dec 07 '11 at 09:56 AM

Seen: 1083 times

Last Updated: Dec 08 '11 at 06:51 AM