Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

UCE0001: ';' excpected. Insert a semicolon at the end. There is a semicolon on the end

$
0
0
#pragma strict private var hasAxe : boolean = false; private var canSwing : boolean = true; private var isSwinging : boolean = false; var swingTimer : float = 0.7; private var controller : CharacterController; private var playerGUI : PlayerGUI-SURVIVAL; function Start() { hasAxe = true; controller = GameObject.Find("First Person Controller").GetComponent(CharacterController); playerGUI = GameObject.Find("FirstPerson.First Person Controller").GetComponent(GUISurvival_Icons); } function Update() { //If we aren't moving and if we aren't swinging, then we idle! if(controller.velocity.magnitude <= 0 && isSwinging == false) { animation.Play("HumanoidIdle"); animation["HumanoidIdle"].wrapMode = WrapMode.Loop; animation["HumanoidIdle"].speed = 0.2; } //If we're holding shift and moving, then sprint! if(controller.velocity.magnitude > 0 && Input.GetKey(KeyCode.LeftShift)) { animation.Play("HumanoidRun"); animation["HumanoidRun"].wrapMode = WrapMode.Loop; } //WOODCUTTING SECTION if(hasAxe == true && canSwing == true) { if(Input.GetMouseButtonDown(0)); { //Stamina reduction applied to the PlayerGUI script playerGUI.staminaBarDisplay -= 0.1; //Swinging animation animation.Play("Swing"); animation["Swing"].speed = 2; isSwinging = true; canSwing = false; } if(canSwing == false) { swingTimer -= Time.deltaTime; } if(swingTimer <= 0) { swingTimer = 1; canSwing = true; isSwinging = false; } } }

Viewing all articles
Browse latest Browse all 1875

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>