Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Controller.cs and keyboard input

Discussion in 'Robotics' started by mcevoy-andy, Sep 20, 2022.

  1. mcevoy-andy

    mcevoy-andy

    Joined:
    Feb 3, 2015
    Posts:
    13
    I'm curious about the intent of having the keyboard control of the URDF in Controller.cs. Why was it done this way? If I don't want keyboard control and the associated messages showing up, I'm editing this script each time?

    Would it not be better to break the keyboard control out of Controller.cs? Should we be writing a custom Controller.cs for our robots?
     
  2. LaurieUnity

    LaurieUnity

    Unity Technologies

    Joined:
    Oct 23, 2020
    Posts:
    77
    You're right, that script is a little weird, it was originally created as part of the Pick & Place tutorial.
     
  3. mcevoy-andy

    mcevoy-andy

    Joined:
    Feb 3, 2015
    Posts:
    13
    Sorry, could you clarify your comment? I'm right that we should rewrite Controller.cs every time or that they keyboard control should be broken out of it?
     
  4. LaurieUnity

    LaurieUnity

    Unity Technologies

    Joined:
    Oct 23, 2020
    Posts:
    77
    Almost all of Controller.cs is there to manage the keyboard control - if you don't want keyboard control, I'm not sure what you would want to leave in when you rewrite it. Just the bit of the Start function that sets jointFriction and angularDamping, I guess?