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 Shirou14 · Nov 25, 2012 at 05:32 AM · camerarotationnavigationthird-persongeometry

3rd Person Camera Geometry Navigation

I need some help figuring out how to make my third person camera navigate geometry to follow the player. I'm using the Mouse Orbit code for the camera at the moment (seen here http://wiki.unity3d.com/index.php?title=MouseOrbitImproved) but it's solution to this is simply to move the camera close to the character until there is nothing between the two. this works in a pinch, or in tight spaces, but say I have a wall in the middle of no where for whatever reason.

It makes more sense to me to have the camera rotate around the player until the wall is no longer in the way. or otherwise have the camera avoid the wall. Does anyone have any solutions or suggestions for this? I've considered raycasts, but I'm not even sure what direction to cast them in. Thanks!

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

Answer by sirival · Nov 25, 2012 at 04:52 PM

What I've done in the past and worked pretty reasonably was to cast a ray from the player towards the camera. If the ray hit an obstacle then I smoothly move the camera towards the intersection. That way the camera is always in front of obstacles walls etc. this might be a problem in tight corners but in any case you should design your levels in a way that the camera is not obstructed by lots of obstacles.

Comment
Add comment · Show 2 · 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 Shirou14 · Nov 26, 2012 at 12:43 AM 0
Share

Thanks, but the Orbit code I'm using already does that. what I want the camera to do is move around geometry ins$$anonymous$$d of just zoo$$anonymous$$g in.

avatar image sirival · Nov 26, 2012 at 08:26 AM 0
Share

Then maybe the article about camera collision and avoidance here: http://gamecodermag.com/game-coder-mag-022012/ might help you 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

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

3rd person camera view lock 2 Answers

Turning a character to match camera rotation 0 Answers

3rd Person Camera with fixed rotation 1 Answer

RTS Camera Rotation and Movement 0 Answers

How to make camera rotation relative to target. 3 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