x


How to show player script variables on screen?

Hello.

I am working on a prototype for a future project and would like to be able to display player variables such as player speed, fall speed and so on. Sort of like a console, but only the player variables.

I think i saw somewhere how to display this on the camera object, but can't find it. Could someone point me in the right direction? :S I am using JS.

more ▼

asked Aug 17 '10 at 12:20 PM

remvan3d gravatar image

remvan3d
49 8 8 14

do you mean a GUI text?

Aug 17 '10 at 12:50 PM 3dDude
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first
var speed = 20;

function OnGUI () {
    GUI.Label (Rect (10, 10, 100, 20), "Speed = " + speed);
}
more ▼

answered Aug 17 '10 at 01:25 PM

spinaljack gravatar image

spinaljack
9.1k 18 31 91

But this is static. I want it to change depending on movement speed and such. Sort of like a stat.

Aug 19 '10 at 11:28 AM remvan3d

change "speed" to your variable

Aug 19 '10 at 12:50 PM spinaljack
(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:

x2981
x342
x144
x33

asked: Aug 17 '10 at 12:20 PM

Seen: 1743 times

Last Updated: Aug 17 '10 at 12:20 PM