Hello I’m working on a simple power up script that allows the user to click on a button to slow down the movement of the player.
Here’s the script I’m using:
var mySkin : GUISkin;
function OnGUI () {
GUI.skin = mySkin;
if (GUI.Button (Rect (10, 50, 80, 30), "Slow Down")) {
var script4 = GetComponent("Movement");
script4.enabled = false;
var script5 = GetComponent("Movement - Easier");
script5.enabled = true;
}
}
What’s got me stumped is how to make the power up script only activate for a certain amount of time before it becomes deactivated and the player’s movement goes back to normal.
Thank you for any answers or feedback. -Ben