- Home /
Script triggering
Hello guys . . . i have a problem with a triggering script . . . well, i made a "Score.js" script that include a static "Score" variable = 500, and another "Item.js" Script that instruct the "Score.Score" += 500 when a player hits an item . .
then, i wanna make a requirement, . . when the "Score.Score" <= 1000, in "Requirement.js", a variable named "Activate_this_script" = true;
but the "Activate_this_script" doesn't turn to true at all, even the "Score.Score" >= 1000; . . .
i have no idea what's goin on . . . can someone help me solving this problem ??
thank you
Is this a typo here, or also in the script, that you write = second?
Edit your question and post the relevant part of your script - how could we help you without seeing it? You must also give some details: is the trigger script attached to the object or to the player? What is the player - CharacterController, rigidbody, simple object?
You shouldn't name a variable with the class name, it's terribly confusing. I'm not even sure why the compiler is allowing it. Choose something like val, actualScore, count or whatever. About your question, see aldonaletto's comment.
ahh sory for the "<=" , and thanks for your reply, . . . i've figured out the problem . . it's all about Update and variable, i've missed a little thing there . . .
Your answer
Follow this Question
Related Questions
Saving variables? 3 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Accessing Script From Other Script Causes Lag? 1 Answer
Another way to reference scripts? 2 Answers
Assigning varaibles to prefabs 1 Answer