Transfer a constantly-updating property to an object in another scene?

Hi Folks,

In one scene I have a jeep, using the vehicle wrapper, and the jeep has a property which carries it’s speed.

In another scene, the HUD overlay, I have a speedo, which needs to use that speed property.

My problem is, how can I copy the value of the Jeep’s “speed” property into the Speedo’s "speed property?

Cheers, If you need a better explanation let me know.

Alex

you can save the speed variable as a global variable:


import GameLogic as g
c = g.getCurrentController()
owner = c.getOwner()
g.speed = owner.speed

let this script run every time the speed variable schanges
then you let the speedo`s object check if your variable has changed:


import GameLogic as g
if hasattr(g , "speed"):
      c = g.getCurrentController()
      owner = c.getOwner()
      owner.speed = g.speed

another way to do this is by sending a message to the speedos object with the property every time the property changes but i dont know if this works through different scene’s