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 Chris 17 · Feb 15, 2011 at 05:32 PM · cameramouselookat

Cockpit Camera Lookat

This is probably quite easy, but I've been banging my head against the wall for a while now, using the in game assets scripts, (mouse lookat and stuff)

I just can't seem to find a script that will do the following:

I want a camera.position to follow my carcamera.position, inside the cockpit, but when the user presses MOUSE1, the camera will pan around allowing the user to look around, but then when the user releases mouse1, the camera lerps back to it's "default position" (straight ahead)

I figure it's something to do with LookAt, but beyond that I get a bit stuck... As I'm pretty poor at 3d maths...

If anyone could point me at a script that does something similar, that'd be great.

Comment
Add comment · Show 3
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 e-bonneville · Feb 15, 2011 at 06:00 PM 0
Share

Have you had a look at the default $$anonymous$$ouseLook script?

avatar image Chris 17 · Feb 17, 2011 at 12:53 PM 0
Share

Yes, I've had a look at the $$anonymous$$ouseLook Script, but that seems to rotate round an axis - which isn't quite what I'm after...

I'm using this code:

function LateUpdate () { // Horizontal

 var rotH = transform.localEulerAngles.y + Input.GetAxis("$$anonymous$$ouse X") * sensitivityH;
 rotH = ClampAngle(rotH, $$anonymous$$H, maxH);
 transform.localEulerAngles.y = rotH;
 
 
 var rotV = transform.localEulerAngles.x - Input.GetAxis("$$anonymous$$ouse Y") * sensitivityV;
 rotV = ClampAngle(rotV, $$anonymous$$V, maxV);
 
 transform.localEulerAngles.x = rotV;
avatar image Chris 17 · Feb 17, 2011 at 12:54 PM 0
Share

argh, that didn't help...

:(

0 Replies

· Add your reply
  • Sort: 

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

How to setup camera look at mouse on right click 0 Answers

simple camera script 0 Answers

Adjust camera rotation while looking at a target 1 Answer

Camera rotate with mouse in TPC 0 Answers

I'm having problems with running my game on Ubuntu/Linux. 2 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