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

Newbie Camera Controller Challenge

Discussion in 'Scripting' started by bigmisterb, Apr 5, 2014.

  1. bigmisterb

    bigmisterb

    Joined:
    Nov 6, 2010
    Posts:
    4,221
    Hello everyone,

    This challenge is issued towards everyone, but more specifically Newbies. (People who know what they want, but just can't seem to get there.) It is specifically geared to learning how to control rotation, position and movement of an object as it relates to the world, or only one other object.

    Rules: You must come up with some code that controls one of three types of cameras. (Look Camera, Orbital Camera and Security Camera(s)) These are really the only basic camera's in 3d gaming. The code must be documented. You must understand what each line is doing and why, then you must convey that to anyone who looks at it. It may be written in any language that Unity Supports.

    There should be something said in this section about the code. You are allowed to use code as a reference, but you should not take another person's code and claim it as your own. This challenge is about learning.

    The options as stated before:

    Look Camera - A camera which must be attached to a pivot point, and is controlled by a mouse, joystick or dual joystick. The camera type is most commonly referred to as a FPS camera. You control the movements of your character via a keyboard or joystick and the camera is your aiming device.

    Orbital Camera - A camera which orbits an object and is controlled by a mouse, or joystick. Common features of this type of camera are that they rotate 360 degrees, zoom in and out. A RTS camera can also be considered a Orbital Camera, it is attached to an object and the object maintains Y rotation and the camera maintains X rotation.

    Security Camera(s) - A camera that acts as a fixed position or fixed look camera. This of course would require no code, but this isn't a challenge about NO code. ;) Security Cameras should be similar to Look Cameras. They pivot, but may be limited in the distance that they can pivot. Furthermore Security Cameras also may be managed cameras, meaning that another script may swap between them and the user controls which one he is looking at, and controls them.

    Features: You may add any feature that could fit into the options as stated before. You may also do anything else that would fit in with the overall concept of the design. (i.e. Head bob on a Look Camera, timed returns on an Orbital Camera or clamped angles on a Security Camera.)

    Posting: You will be required to post your completed, commented code in this thread. This means that you should put something at the head of your code stating that it is free for others to use. I would also include a part that states that anyone using the code must also leave the head in it so you will be recognized as the originator. It is very important that newbs understand that using others code should always refer back to the originator.

    Remember, this is a challenge, not a competition, everyone's a winner, just like pee wee league.