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

Looking for tutorials on Diablo style camera

Discussion in 'Community Learning & Teaching' started by EDarkness, Feb 1, 2013.

  1. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    I've been looking around for tutorials on how to create a Diablo style camera where it follows the player. The camera doesn't need to move around, just follow the player around. I created a cube (for testing purposes) and attached a camera to it and even used (0,0,-10) and (30,45,0) as stated in just about all the information I've found, but I'm not sure what to do now since just setting these values gives me a camera that's too far away and strange behavior for my cube. I deleted the main camera a new project starts with, but it just isn't working.

    Anyone know of any tutorials that get into how this is done? Honestly, I'm rather surprised that Unity doesn't come with this in the standard files along with the FPS and third person camera options. Any help would be greatly appreciated.
     
  2. wccrawford

    wccrawford

    Joined:
    Sep 30, 2011
    Posts:
    2,039
    Import the 'scripts' asset and use the 'follow' and 'look at' scripts on the camera.
     
  3. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    Okay, if I add these scripts, does the camera have to be a child of the player or does the player have to be a child of the camera? Also, the camera is cutting off a chunk of the landscape.
     
  4. wccrawford

    wccrawford

    Joined:
    Sep 30, 2011
    Posts:
    2,039
    It does not have to be a child of the player, or vice versa. They can be completely independent. The script goes on the camera, and the script has a option for the target to follow/look at.

    Dealing with terrain issues on the camera is more complex and will require writing a script from scratch.
     
  5. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    This is why I was looking for some tutorials on how it's done. I'm new to Unity and don't really know much about this. I just want to get my camera in the right place so I can work on other things. What gets me is that there's a FPS camera, but not one for this kind of camera. Seems like it'd be a rather popular standard camera.

    There are so many different ways I've heard to do it that I'm totally confused as to how to do it. Anyone know of any tutorials that might help?
     
    Last edited: Feb 2, 2013