# How to make gauges for racing game?

I am making a racing game and I want to know something: How do I make gauges for my game. I have 6 gears on car set by states, but only way to visualiate them is game debug. But game debug is ugly- I want to make fancy gauges. How do I make them?

• Hi, please only ask one question at a time. If you want to ask multiple questions then please ask them separately as separate posts. – Ray Mairlot Dec 19 '14 at 13:27
• But if they are about one and the sme thing, just 2 actions- can't I ask them both in one place? This is easier for me to check for answers... – Adrians Netlis Dec 19 '14 at 13:46
• I don't think they are the same. One is about visualising data and one is about getting a car to accelerate. – Ray Mairlot Dec 19 '14 at 14:28

Assuming the gauges are in an overlay scene, you'll need to establish communication with message sensors.

1. Send a "gearUp" or "gearDown" message to the gauge when the gear changes
2. Put message sensors on the gauge that execute whatever action you desire

Here's a quick sample - use the up and down arrow keys to send messages. https://dl.dropboxusercontent.com/u/19279604/static/misc/gauge_example.blend

If the gauges are in the same scene, then it's a whole lot easier. You can shift+click multiple objects and connect gauge actuators directly to the gear controller.

EDIT

There really isn't a good way to copy properties between scenes with logic bricks. Here's a Python example that can be adapted to your needs:

import bge

def copyProps(cont):
# Get a reference to the object running the script
own = cont.owner

# Get a reference to the overlay scene
overlay = bge.logic.getSceneList()[1]

# Find the object in the overlay scene
other = overlay.objects['Speedometer']

# Copy the desired properties
other['Text'] = own['speed']

if __name__ == '__main__':
cont = bge.logic.getCurrentController()
copyProps(cont)

• I will check it out, but looks useful. Can you also show, how to make it show property value?(I have "speed" property) – Adrians Netlis Dec 20 '14 at 17:04
• Unfortunately we can't directly copy properties between scenes with logic bricks. You're pretty much stuck with sending incremental messages. I suppose you could send a message for each unit of speed, but that's a bit silly. I've edited the answer to include a Python script that directly copies properties. – pqftgs Dec 20 '14 at 18:36
• What object is Speedometer? Which one shouldI call Speedometer? – Adrians Netlis Dec 20 '14 at 19:49
• Should I make evrything else like in your example? Where should I put the scrip controller? – Adrians Netlis Dec 20 '14 at 19:50
• Actually, there is an alternate- I can put gauges in the same scene, maybe- I will try... – Adrians Netlis Dec 20 '14 at 19:50