Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Needing help with camera/player motor.

Discussion in 'Scripting' started by Christian-Tucker, Oct 14, 2014.

  1. Christian-Tucker

    Christian-Tucker

    Joined:
    Aug 18, 2013
    Posts:
    376
    So, I'm trying to make something simular to what you would see in any type of action combat game, I've actually gotten pretty far in my development, but my camera has always been.... well... less than functional.

    I have a cross-hair on the center of my screen, and basically what I want it to do is to have the player follow the mouse around, by rotation. The problem with this is that the only way I understand how to do it is to have the player rotate towards the mouse...

    This works, but the problem is the player will never stop rotating, the reason for this is because the mouse stays in the same spot, and the player endlessly tries to play a game of catch.

    Here's a video of the type of "Mouse follow" functionality I'm trying to achieve.

     
  2. Nubz

    Nubz

    Joined:
    Sep 22, 2012
    Posts:
    553
    Have you tried looking on the asset store for the 3rd person shooter project?
    It has the cameras you are looking for. Its a little old but would be at the least a starting point.
     
  3. Christian-Tucker

    Christian-Tucker

    Joined:
    Aug 18, 2013
    Posts:
    376
    No, I haven't. I will do so now, thank you!
     
  4. Christian-Tucker

    Christian-Tucker

    Joined:
    Aug 18, 2013
    Posts:
    376
    It does what I need it to, it's pretty buggy, but is still heaps better than what I had.
     
  5. Nubz

    Nubz

    Joined:
    Sep 22, 2012
    Posts:
    553
    Not sure what you see as buggy it seems to work as intended when I load it into Unity.