Personal Reference post for Scripting (Ignore, just saved my hide by keeping this information)

Richard’s helpful insights to change my current Code in our third prototype.

What you might do is change “YourFucked2” to Tripwire(); then you can throw in a timer that resets and in Update, have the code to stand him back up when the timer reaches say .. 0.7second or so ..

in Player2dController there is one at the moment :

if (jumpingTimer >= timeForNextJump)

{

jumping = false;

jumpingTimer = 0.0f;

}

jumpingTimer += Time.deltaTime;

so the timer can be running in Update TripWire() restes it to 0.0f

if(jumping)

{

jumpingTimer += Time.deltaTime;

//                                            Debug.Log (jumping);

//                                            Debug.Log (jumpingTimer);

}

If the player jumps, the bool is set to true and then the timer starts.

when it gets to a certain point the bool is turned off, whatever happens is set to happen then the timer is reset, waiting for the next time the bool is activated.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s