Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by kevdotbadger · Mar 01, 2011 at 10:32 PM · camerarotatecamera-look

RTS type of camera

Hay, i was wondering how i would go about creating an RTS type of camera system. Where you would use the mouse to rotate a character and use WASD control scheme to move forwards, backs and sidestep. The camera would be fixed on the player, and wouldn't rotate.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by digitalConundrum · Mar 02, 2011 at 12:56 AM

The simplest way I can think of to do this would be to create the camera as a child of your unit. Since you want it to be attached to the unit, I'm guessing that you didn't really mean that you want an RTS camera(as those are usually unattached and give a birds-eye view. I'm going to go along with the assumption that you meant RPG.

As you don't want the camera itself to rotate it seems the best choice would be to attach it to your unit and position it as desired. Then you could add a collider to the camera (box or sphere most likely) and write a script to move the camera closer to the unit if the camera collides with something..say if your unit is backed up against a wall...and to move it back to the original position when the collider is no longer in contact with anything.

As for moving using wasd and the mouse...there is a character controller built into Unity if you don't mind allocating the resources to using it...otherwise its up to you to write your own movement script.

Take a look at the scripting reference, It's wonderfully done and is the most helpful documentation I've ever used.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tingham · Mar 02, 2011 at 01:03 AM 0
Share

Definitely look at using dynamic parenting in code so that you can quickly move the camera between units without having to duplicate your camera control code.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Logical Camera errors... 1 Answer

How to make my camera only rotate on middle mouse click? 1 Answer

Rotating a camera that has MouseLook.cs attached 0 Answers

Camera Rotation Tips 1 Answer

Make camera rotate don't stop 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges