x


On screen movement control?

i want to be able to have like some gui buttons on screen saying left,right,forward,backward. so when the player presses them the character moves.help me please?

more ▼

asked Jul 29 '11 at 04:56 PM

buskins gravatar image

buskins
61 7 7 8

Have you made an attempt? Have you read the documentation? Have you tried tutorials? Have you searched for questions on similar topics?

Jul 29 '11 at 05:03 PM Chris D
(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

you can use a script like this

function OnGUI()
{
    if(GUILayout.Button("Forward")
    {
       //forward Controls here

    }
    if(GUILayout.Button("Backward")
    {
       //backward Controls here

    }
    if(GUILayout.Button("Left")
    {
       //left Controls here

    }
    if(GUILayout.Button("Right")
    {
       //right Controls here

    }

}

you can improve upon this if you like.

more ▼

answered Jul 29 '11 at 05:04 PM

TheDarkVoid gravatar image

TheDarkVoid
889 12 22 27

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

I would take a look at GUI.Button.

more ▼

answered Jul 29 '11 at 05:09 PM

OrangeLightning gravatar image

OrangeLightning
5.3k 47 57 111

(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:

x3670
x1363
x223
x1

asked: Jul 29 '11 at 04:56 PM

Seen: 847 times

Last Updated: Jul 29 '11 at 08:07 PM