Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 Baxter · Jan 19, 2010 at 01:50 PM · cameragamecontroller

Mouse Look / Cursor

Hello All,

I am very new to Unity and scripting, but wondering if I could get some help from you guys and gals :-)

What I am trying to achieve is a camera script like the one used in Call of Duty (the 3rd person one, not a standard FPS). I would ideally then like that camera script to be applied ONLY when "equiping a weapon". When no weapon is equiped I would like to use a camera similar to WoW (which I have found a few scripts for).

In a nut-shell I would like 1 button (Ctrl for example) to switch between "passive mode" (this has WoW based camera) and "action mode" (this has CoD based camera). Is this possilbe?

As I said I am rather new to both unity and scripting so please explain as much as possible, I am very eager to learn! If anyone has links to tutorials or other online resources that would help me with this would be much appreciated!

Thank you very much for all your help in advance!

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 Jaap Kreijkamp · Jan 20, 2010 at 12:10 AM

A way to do it without understanding too much of scripting is create two separate camera's each doing one of the behaviours and in your player script turn on/off the right camera depending on the action you're doing. This way you can probably getting quite far with stock camera scripts found on the web. Add something like below to your player script and connect the passiveCamera/actionCamera properties with the right Cameras in the inspector. Now you have two simple functions to switch between the camera's.

var passiveCamera : Camera; var actionCamera : Camera;

function ActivatePassiveCamera() { actionCamera.gameObject.SetActiveRecursively(false); passiveCamera.gameObject.SetActiveRecursively(true); }

function ActivateActionCamera() { passiveCamera.gameObject.SetActiveRecursively(false); actionCamera.gameObject.SetActiveRecursively(true); }

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 Baxter · Jan 24, 2010 at 10:03 PM 0
Share

Thank you very much for your response! Soon as I can I will try this out! :-)

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

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Need help with script, one time touch to the screen = synchronize camera with face 0 Answers

How to apply target, while created at runtime? 1 Answer

Backgrounds moving at different speeds? 1 Answer

Problems implementing a 3rd person static camera 0 Answers


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