SimHub icon indicating copy to clipboard operation
SimHub copied to clipboard

[QUESTION] function player position in class

Open FullPace opened this issue 6 months ago • 0 comments

Hi,

I still struggle with my gaps pages. Maybe you remember from a few months back, I had wrong results when asking for the gap times, distances and positions with the "driver" functions.

For testing I switched to your leaderboard quick components which work fine when set to Player Class Only and relativetoplayer settings.

What I don't understand is, how get a similar result with the functions.

Example:

I want to change the text color to red if an opponent comes very close. How can I target the opponent in the formular?

I tried this

if(
drivergaptoplayer( driverclassposition( [Position]+1 ) ) < 0.5,
 'red','white'
)

which isn't working.

I assume the problem is that [Position] is not the class leaderboard position and therefore it returns data from another opponent. Relativeindex isn't available in this function either.

What would be the right property in this case?

TIA

FullPace avatar Jun 22 '25 10:06 FullPace