Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- public var one_press : boolean;
- //public var timer_running : boolean;
- public var delay : float;
- public var two_press : boolean;
- public var can_dodge : boolean;
- public var two_press_timer : float;
- public var dodge_direction : Vector3;
- public var Player : Transform;
- function Update(){
- Debug.DrawRay(Player.position, -Player.right, Color.red, 1);
- if(Input.GetKeyDown(KeyCode.A)) {
- if(!one_press)
- {
- one_press = true;
- delay = Time.time + .2;
- }
- else
- {
- one_press = false;
- two_press_timer = 0.3;
- two_press = true;
- }
- }
- if (Physics.Raycast(Player.position, -Player.right, 1))
- {two_press = false;
- }
- if(one_press)
- {
- if((Time.time - .2) > delay)
- {
- one_press = false;
- }
- }
- if (two_press)
- {
- two_press_timer = two_press_timer - Time.deltaTime;
- transform.Translate(Vector3.left * 20 * Time.deltaTime);
- if (two_press_timer < 0)
- {
- two_press = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement