Advertisement
PabloMarques

Codigo movimentação camera javascript

Mar 30th, 2015
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #pragma strict
  2.  
  3. var Velocidade: Vector3;
  4.  
  5. function Start () {
  6.  
  7. }
  8.  
  9. function Update () {
  10.  
  11. Velocidade.x =0;
  12. Velocidade.y =0;
  13. Velocidade.z =0;
  14.  
  15. if (Input.mousePosition.x<=5 || Input.mousePosition.x>=screen.width-5)
  16. {
  17. Velocidade.x = Input.GetAxis ("Mouse X")*10*Time.deltaTime;
  18. }
  19.  
  20. if (Input.mousePosition.y<=5 || input.mousePosition.y>=screen.height-5)
  21. {
  22. Velocidade.z = Input.GetAxis("Mouse X")*10*Time.deltaTime;
  23. }
  24.  
  25. transform.Translate(Velocidade);
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement