Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

171
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda