[code release] 3rd Person Camera with collision detection and "perfect aim"

I’ve spent too much time perfecting this 3rd person camera, and the results were 100 times better than I expected… so why not share it? It’s easily customizable, so all the 6 different views I toggle between in the video can be changed by simply changing a few variables.

Camera Features:

  • camera height depending on how tall the hero is and whether they are crouching or standing.
  • detects collisions with the map and other players.
  • Two different camera types:
    1. Standard 3rd person camera.
    2. 3rd person camera with “aim correction” (crosshair points exactly where the player will hit, shown 55 seconds into the video).
  • Both cameras have adjustable settings, so you can easily customize the camera view by changing a few variables.
  • Comes with 6 different presets that you can either keep or delete:
    1. Standard view with a slight horizontal and vertical offset.
    2. similar to above but with limited vertical camera movement.
    3. No offset (camera is centered behind player).
    4. Only vertical offset (camera is centered but elevated a bit).
    5. Shoulder view.
    6. Shoulder view for bigger heroes.

code: TCQ42

Let me know what you think!
I’d love to see this come to good use in your custom games

Edit: I almost forgot! Here’s a list of player variables that change the camera view:

(Settings variables)
  • S[0]: Distance from player
  • S[1]: Vertical position multiplier (value between 0 - 1). A low value limits height changes in the camera. 1 is default
  • S[2]: X offset (right - left)
  • S[3]: Y offset (down - up)
  • S[4]: Z offset (backward - forward)
11 Likes

I like 1st one, free of hero.

1 Like

Update:
I spent some more time making a good shoulder camera preset:

Code: 0GNJ3
(copy the rule in this code and paste it to the code from the main post. Read the description after importing)

The issue with shoulder view cameras is that heroes have different sizes, which can cause the camera to clip through the hero at some angles. These settings take that into account to get a decent view for all heroes.

Just wanted to say I’ve been playing around in the settings and so far this is the best version of a 3rd-person camera I’ve seen!

2 Likes

I feel when you strafe it’s really weird pls fix that