Author Topic: Advanced RTS Camera Prefab  (Read 2281 times)


  • Junior Playmaker
  • **
  • Posts: 52
    • View Profile
Advanced RTS Camera Prefab
« on: December 31, 2012, 05:21:16 AM »
Hi all, I've decided to crack the shell and start using playmaker now that unity 4 is out and playmaker is fleshed out to be what it is today

so my project is an RTS mech game and I need a camera
the Camera I'm developing is losely based on the Hutong Tutorial but features a more stable and controllable setup

the original camera, if you've tried to make it, isn't exactly the greatest strategy camera
This camera consists of 2 parts, a rigid sphere (to be changed) and a camera
its setup similar to a tripod setup where the camera focuses on the sphere being the target

I've hit a few problems where my tutorial experience has left me dry

Problem 1, is making the camera walk over the terrain without using physics or gravity as a 'hack'
terrain being any objects on that specific layer and using its height data to 'smooth' to it

Problem 2, i need to somehow make the camera move along its Z axis of something comes between the camera and target (like the camera hitting a cliff in the terrain as the camera pans)

Problem 3, to fix/improve the Zoom function by making it smooth closer at a speed of 3 and zoom out at a speed of 5 and to clamp it at 3-16

Bonus 4, being able to define a costum region (cubes?) that the camera can move inside, and stopping it from leaving the cube/area

Attached is my current Dev WIP, its somewhat rough as i need to patch the rest of it out, the rigid body is a hack of what im trying to achieve, but it needs to follow only mesh/terrain on a specidied layer

I'm hoping the global variables are included, if not i apologies
once its finished, hopefully with some help, i'd love to release it to Hutong Games to be included as an advanced Prefab
« Last Edit: December 31, 2012, 01:38:28 PM by digimbyte »