Page 1 of 1

[Help] Collide engine throttle script.

PostPosted: Thu May 14, 2015 7:20 pm
by InsertNameHere
In my most recent scenes, in the script that the collide engine has for the throttle, (The invisible box that changes size in the engine) you would need two keys to throttle it; one for increasing throttle and another for decreasing throttle. Could anyone change my script I have to make it where you press a key and it increases the throttle, but when you let go of the key, the throttle decreases back down to the smallest size. It would be much appreciated if you help me on this, I've tried to do it on my own and I failed horribly. :oops:

Re: [Help] Collide engine throttle script.

PostPosted: Fri May 15, 2015 12:51 am
by pnvv
What I'd do is declare a local variable in your throttle-box, and name it _limit or something. Then put in poststep some script that uses keybinding to recognize whether you pressed whatever throttle key you wanna use (I do up arrow or W), then an if clause that adds to the width of your box based on whether you are on the throttle! Then declare a second variable called _throttle or something, and set it up so the box cannot get bigger than a specified size, aka _throttle cannot exceed _limit.

If that was hard to understand, here's a scene explaining it :thumbup:

Rating: rated 5
Filesize: 97.7 kB
Comments: 6
Ratings: 1
download