Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
My variable outputs 'null' even though I gave it a value

as you can read in the title I have a problem. The value of x outputs null even though (I think) I give it a value.

What I want to do is check if x has a value. If it doesnt have a value give it the value of '$prop('BrakeBias')' (the value can vary between 50 and 70) after that I want to store that value of x and don't change it even if '$prop('BrakeBias')' changes. After that it needs to run again and check again, if everything is right it will detect x has a value and go to the else statement. Then I want it to give y the same value as x but y needs to update evertime '$prop('BrakeBias')' updates. If something updates I want to subtract y from x and calculate the outcome.

I checked: let's suppose '$prop('BrakeBias')' equals 50. Then the output of x is null, the output of y = 50 and xy = -50 because 50 will be substracted from 0 so -50. I don't understand what is going on and why it does not work. I need to store the first value of x (because '$prop('BrakeBias')' can change because the player controls the value) and leave it alone and dont update it but idk if iam doing that right now.

if (x = null) {
    var x = $prop('BrakeBias');
} else {
    var y = $prop('BrakeBias');
    var xy = x - y;
    return xy;
}

Thanks for looking!

I am looking forward to see your solutions!

Greetings, Peter

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!