Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
1
Question by Reverend-Speed · Nov 06, 2015 at 05:32 PM · rigidbodycharacter controllercamera rotatecamera movementrigidbodies

Should moving cameras have rigidbodies?

Idle, nitpicking question here. I'm building a first person character controller from a rigidbody and when I was setting up the camera, started to wonder if I should add a rigidbody to the cam too, in order to avoid rebuilding the graph, to allow some movement tricks, etc.

I'm guessing the answer is NO (as inheriting y rotation from parent body is easier than getting the rigidbodies to line up w/player input, as an example), but I'd started to get so much into the habit of using Rigidbodies for ANYTHING that moved/required collision (and moving/rotating through moveposition/moverotation) that I figured I'd ask. Anybody got a best practice?

--Rev

Comment
Add comment · Show 2
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 Dibbie · Nov 06, 2015 at 05:39 PM 0
Share

Your right, I would say its a bad idea to add a rigid body to a new setup, though if you want to put some time into making sure the rigidbody doesnt conflict with your player in any way, but want to keep the rigid body on the camera, only for the purpose of, if you hit a wall, the camera wont clip through the wall, but you may need to add code to allow the camera to snap back to the players focus, otherwise it will just stay dodging the wall, even when you have moved passed it.

Im sure theres a better way to do stuff like that, you probably could do it all by code by just simply using a sphereCollider, with a trigger, and checking the trigger for tags of an object like a wall, and simply working the camera around the location of the wall, but rotating to still be focused on the player.

avatar image Reverend-Speed Dibbie · Nov 06, 2015 at 06:00 PM 0
Share

Doubt that cameras clipping through walls will be an issue, as I've set my cam near clipping plane to .1 and the cam is located within the 'head area' of the body capsule collider.

I just kept worrying that Unity would have to keep redraw the level graph a bit due to the camera moving a little independently of the body (I intend adding some anticipation / inertia effects with the cam in relation to the body velocity (also fov, etc)).

Thanks for having a think about this, though! I'm in the middle of ripping out the rb code on the camera...!

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

33 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to fix player camera shaking 0 Answers

Rigidbody Character Controller - Why Mouse Air Control? 0 Answers

I can't seem to get this movement + automatic lookat the direction of movement work for a 2.5D game 0 Answers

When attaching my custom camera script camera shakes when player starts to move fast. 1 Answer

Rigidbody sticks to wall 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