Code Monkey home page Code Monkey logo

stratecam's Introduction

Stratecam

(an open-source RTS-like camera system for Unity)

Important Information

This repository contains an example project that includes a few Unity Standard Assets. These are distributed here only as part of the example scene to demonstrate the capabilities of Stratecam. If you are not interested in that and only want the component itself to test it out in your own project, feel free to proceed to copy the two .js scripts in the Scripts directory and nothing else.

Installation

Getting Stratecam running is pretty easy. You simply need to get a copy of the Stratecam and DoubleClickDetector js files in the Scripts directory and copy them to your project. Once there, simply add the Stratecam component to your camera, set the options and you are good to go!

Where can I see a demo?

You can find a demo of the latest version of Stratecam here.

What do the options mean?

Almost all of the settings are pretty much self explanatory, but here are the details:

  • Terrain: If you are going to use a terrain object, set the reference here. This is required in order to make the 'adapt to terrain height' and 'allow double click movement' features work.

  • Pan Speed: speed of the movement along the X and Z axis (both mouse and keyboard). Default value: 15.

  • Zoom Speed: speed of the zoom-in and zoom-out movement (both mouse and keyboard). Default value: 100.

  • Rotation Speed: speed of the rotation movement in the Y axis (both mouse and keyboard). Default value: 50.

  • Mouse Pan Multiplier: speed of the pan movement for the mouse only in order to make it slower or faster. Default value: 0.1.

  • Mouse Rotation Multiplier: speed of the rotation movement for the mouse only in order to make it slower or faster. Default value: 0.2.

  • Mouse Zoom Multiplier: speed of the zoom movement for the mouse only in order to make it slower or faster. Default value: 5.0.

  • Minimum Zoom Distance: the closest you can get to the camera target point, in world units. Default value: 20.

  • Maximum Zoom Distance: the furthest you can get from the camera target point, in world units. Default value: 200.

  • Smoothing Factor: value for the linear interpolation used to smooth out the pan movement. A value close to zero represents greater smoothing and a value of 1.0 represents no smoothing at all. Default value: 0.1.

  • Go-to Speed: value for the linear interpolation used when moving the camera automatically to a target. A value of 1.0 makes the camera immediately teleport to the destination. Default value: 0.1.

  • Use Keyboard Input: when enabled, the player will be able to move the camera using the WASD/QE/RF keys.

  • Use Mouse Input: when enabled, the player will be able to move the camera around using the mouse (middle mouse button and scroll wheel).

  • Adapt to Terrain Height: when enabled, the camera will automatically try to remain above the terrain.

  • Increase Speed When Zoomed-Out: when enabled, the panning speed will increase when you are zoomed-out. It is recommended to keep this on.

  • Correct Zoom-out Ratio: when enabled, the distance from the camera to the camera target point will increase faster when you are zoomed out in order to make it non-linear. It is recommended to keep this on to provide a more usable zooming experience.

  • Smoothing: when enabled, smooths out panning to avoid having the camera start and stop the movement suddenly.

  • Allow Double Click Movment: when enabled, double clicking on the terrain will automatically move the camera to that point.

Public Methods

GoTo(position : Vector3)

Moves the camera target point to the specified position.

Follow(gameObjectToFollow : GameObject)

Makes the camera follow the movement of the specified GameObject, keeping it centered in the screen.

stratecam's People

Contributors

federicocasares avatar quakecake avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.