Global variables fo...
 
Notifications
Clear all

Global variables for dashboard

1 Posts
1 Users
0 Reactions
5 Views
(@rojojo)
New Member
Joined: 4 hours ago
Posts: 1
Topic starter  

Newbie question here, unfortunately could not find any answer and ChatGPT is hallucinating. Or most likely I'm doing something wrong.

My aim is to store some custom global properties in the dashboard's session scope.

I want to access those properties in components and JS functions.

 

I've tried the following methods to set values in the local script for a component, but which I could not access elsewhere in another component:

  • $prop('GameData.SetCustomProperty')('myCustomProperty', 'My Custom Value'); 
  • $prop('GameData.SetCustomProperty')("myCustomProperty"), 'My Custom Value');
  • root["myCustomProperty"]; (as seen in <a href=" removed link "> removed link )

I've added minimal update intervals for the components with bindings, which has no effect. I can get the root value (a simple counter, which is updated in a function) to be updated more than once after loaded.

Furthermore, I would like to to know how far advanced a car is the current lap in terms of km distance. Any tips?


   
Quote
Share: