Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Problem with Inputs.

Discussion in 'Editor & General Support' started by carking1996, Apr 28, 2011.

  1. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,608
    Hello, My other thread wasn't getting replied to after 3 bumps, so, I'm making a new one. I have reinstalled Unity, and reset the inputs. But, some objects stay on, and my orbit cam still doesnt work. This only happens when making EXEs or WebPlayers. :( Any ideas now?
     
  2. spaceMan-2.5

    spaceMan-2.5

    Joined:
    Oct 21, 2009
    Posts:
    710
    can you share your project (or at least the project problem) with us?..
    greetings.
     
  3. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,608
    Why would you need my project? This only happens on WebPlayers and EXE's.
     
  4. spaceMan-2.5

    spaceMan-2.5

    Joined:
    Oct 21, 2009
    Posts:
    710
    in such case looks like a build issue...
    have you tried other inputs.. or if input works with other objects.. i.e. pressing 1 show activates a object...
     
  5. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,608
    Only 2 inputs are messed up. An orbit cam(mouse), and tail lights on my car. For those, you press the down arrow.
     
  6. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,608
    BUMP. Anyone?
     
  7. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,608
    Anyone? 2 threads gone ?
     
  8. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,608
    come'on! No replies? I really need this help!
     
  9. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,608
    The inputs are defaults(I reset them).

    Orbit Cam:
    Code (csharp):
    1. var target : Transform;
    2. var distance = 10.0;
    3.  
    4. var xSpeed = 250.0;
    5. var ySpeed = 120.0;
    6.  
    7. var yMinLimit = -20;
    8. var yMaxLimit = 80;
    9.  
    10. private var x = 0.0;
    11. private var y = 0.0;
    12.  
    13. @script AddComponentMenu("Camera-Control/Mouse Orbit")
    14.  
    15. function Start () {
    16.     var angles = transform.eulerAngles;
    17.     x = angles.y;
    18.     y = angles.x;
    19.  
    20.     // Make the rigid body not change rotation
    21.     if (rigidbody)
    22.         rigidbody.freezeRotation = true;
    23. }
    24.  
    25. function LateUpdate () {
    26.     if (target) {
    27.         x += Input.GetAxis("Mouse X") * xSpeed * 0.02;
    28.         y -= Input.GetAxis("Mouse Y") * ySpeed * 0.02;
    29.        
    30.         y = ClampAngle(y, yMinLimit, yMaxLimit);
    31.                
    32.         var rotation = Quaternion.Euler(y, x, 0);
    33.         var position = rotation * Vector3(0.0, 0.0, -distance) + target.position;
    34.        
    35.         transform.rotation = rotation;
    36.         transform.position = position;
    37.     }
    38. }
    39.  
    40. static function ClampAngle (angle : float, min : float, max : float) {
    41.     if (angle < -360)
    42.         angle += 360;
    43.     if (angle > 360)
    44.         angle -= 360;
    45.     return Mathf.Clamp (angle, min, max);
    46. }
    TailLights:
    Code (csharp):
    1. var TL :  GameObject;
    2.  
    3.  
    4.  function Start () {
    5.       TL.gameObject.renderer.enabled = false;
    6.     }
    7.      
    8.  function Update () {
    9.       if (Input.GetKeyDown (KeyCode.DownArrow)) {
    10.           TL.gameObject.renderer.enabled = true;
    11. }
    12.       if (Input.GetKeyUp (KeyCode.DownArrow)) {
    13.           TL.gameObject.renderer.enabled = false;
    14.          
    15.           }
    16.          
    17.     }
    18.      
     
  10. HolBol

    HolBol

    Joined:
    Feb 9, 2010
    Posts:
    2,887
    In your taillight script, the script is saying that if you put the key down once, in a tapping motion, that the taillights will just flick on and off; this is because the down sets it on , but as soon as the key is lifted, your script turns the light off again.
     
  11. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,608
    Yes. that is what it does. :)

    Yes. It works 100% perfect in the editor. ;)
     
  12. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,608
    Yes. On many at my school. Around 10 or so.
     
  13. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,608
    No. I only have unity and my game on this pc.
     
  14. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,608
    I fixed it. It was a problem with the orbit cam script. ;) Thanks for the help. :)