This is what my playerSpeed is set to when I start ^^^
This is what I want to change it to when I collide with a certain object v v v
[34464-screenshot+2014-10-29+10.15.44.png|34464]
When I collide with a certain object i want to increase it by 9000, or change it to 10000, but only for a few seconds, can somebody please explain how I can do this. Sorry if this is too brief!
NOTE: Please ignore the SetText() void, it is for something else.
//This will call the subReset_Player_Speed function in three seconds time.
//Place this line at the end of your trigger event.
Invoke ("subReset_Player_Speed", 3);
void subReset_Player_Speed() {
playerSpeed = 1000;
}
You can check if an Invoke method is already running, which is useful if you triggered this event again within the 3 second time limit, at which point you could cancel the current Invoke and start it afresh.