Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private var timer : int;
- var timeDown : int = 10;
- var timerSubtract : int;
- function Update(){
- if(timerSubtract != 0){
- RunTimer();
- }
- else if(timerSubtract == 0){
- TimerStop();
- }
- if(timer <= timeDown){
- timerSubtract = timeDown - timer;
- }
- else {
- timerSubtract = 0;
- }
- Debug.Log(timer);
- if(timerSubtract <= 0 && transform.position.x < -3){
- transform.position.x += 10 * Time.deltaTime;
- }
- }
- function RunTimer(){
- timer = Time.time;
- }
- function TimerStop(){
- timer = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement