Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var pedra: GameObject;
- var barraJogar: boolean; //ve se esta pronto para o arremesso ou nao
- var tempoGiro: float; //verifia se a a nimaรงao de arremesso foi ate o fim
- function Start () {
- tempoGiro = 0f;
- barraJogar = false;
- }
- function Update () {
- if (Input.GetKeyDown(KeyCode.V)){
- tempoGiro = tempoGiro*Time.deltaTime;
- if (tempoGiro >=0.7f){
- barraJogar = true;
- }
- if(barraJogar ==true){
- Instantiate(pedra,transform.position,transform.rotation);
- }
- if(Input.GetKeyUp(KeyCode.V)){
- tempoGiro = 0f;
- barraJogar = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement