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

Third person controller Script

Discussion in 'Scripting' started by appleunited, Jul 8, 2011.

  1. appleunited

    appleunited

    Joined:
    Dec 25, 2010
    Posts:
    103
    Hi guys,

    Currently I am using the third person controller and camera scripts that come with unity3d. May I know if there is a way to make the turning less abrupt and smooth? Currently each time, I press the left/right key, it will turn 90 degrees. I tried to change a couple of variables like the key sensitivity, rotation speed, etc but nothing helps. Can anyone point me the right direction?

    Cheers
     
  2. appleunited

    appleunited

    Joined:
    Dec 25, 2010
    Posts:
    103
    Can anyone help? Thanks. :)
     
  3. Nikdy98

    Nikdy98

    Joined:
    Jul 6, 2011
    Posts:
    192
    change the sensitivity?
     
  4. appleunited

    appleunited

    Joined:
    Dec 25, 2010
    Posts:
    103
    I tried that already but there isn't much use. I think the sensitivity is more of how fast it reacts to your control but somehow it still makes a 90 degrees turn. My horizontal input comes from the keyboard "A" and "D" keys.
     
  5. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    The third person controller that comes with Unity is a bit complicated to follow and to understand. Lots of code. Making your own controller may be the easier way here. Sorry that i have no better advice.
     
  6. appleunited

    appleunited

    Joined:
    Dec 25, 2010
    Posts:
    103
    Hi Tiles,

    Kind of agree with you. I have been spending the past 2 days trying to understand the codes but still quite lost (new to 3d gaming).. It is a convenient way to get things started but any customization after that is a pain..

    Anyway, thanks for your advice.
     
  7. MidnightQC

    MidnightQC

    Joined:
    Jul 9, 2011
    Posts:
    2
    Both scripts are faily easy to follow and they do exactly what they mean to do, which is the exact opposite of what you are trying to acheive.

    Thoses 2 scripts are working together to allow the player to move around by "pointing" where they wanna go. It's the direction of movement that is retrieved from input. Pressing 'A' means: i wanna go to the left in reference to the camera point of view. It doesnt mean i want to turn left.

    Nowhere in thoses scripts there is an actual rotation made to your avator. The rotation you see in the scripts are to "lineup" your avator's foward vector with his direction of movement. This is why you think you are rotating your avator by 90deg.

    So your only options left are either write your own controllers or search the web for an already implemented solution.

    Hope it clears it up.
    Good luck.
     
  8. appleunited

    appleunited

    Joined:
    Dec 25, 2010
    Posts:
    103
    That definitely clear things up a lot! Appreciate your input.. Hope I can find some scripts to help me out.