x


Move objects in units

For a part of my my game i want it to move only six units at a time when you hit the button but instead it moves 6 units per second.

Basically, Can 6units/second Can't 6units/when the button is hit

more ▼

asked Mar 01 '12 at 06:39 AM

Gamer2470 gravatar image

Gamer2470
11 1 3

Well, like all things in scripting, you should be telling it to do that, instead of what you're telling it to do now.

Mar 01 '12 at 08:27 AM syclamoth
if(Input.GetKeyDown(KeyCode.whatever)) 
    movingObject.transform.translate(movingObject.transform.whateverDirection * 6);
Mar 01 '12 at 09:17 AM asafsitner
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
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:

x496
x43
x31

asked: Mar 01 '12 at 06:39 AM

Seen: 445 times

Last Updated: Mar 01 '12 at 09:17 AM