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
0
Question by RonHiler · Sep 15, 2015 at 11:18 PM · camera-movementtriggers

Camera being affected by sphere collider triggers

Hey all,

I have a strange problem, maybe I'm missing something obvious, but I can't seem to figure it out.

I have an FPS controller with a camera attached. On the camera is a rigid body. This rigid body uses both gravity and is kinematic (in fact, this is simply the default FPS controller that comes in Standard Assets with Unity 5.1.1).

Now, I have a bunch of sphere colliders in my scene, about 400 or so. They are set to Triggers, with a radius of 100. At the scene opening, the camera is inside about 140 of these triggers. I have routines for OnTriggerEnter and OnTriggerExit (nothing in OnTriggerStay, so there is nothing continuously firing).

I'm given to understand that since I have these set as triggers, they should have no effect on the physics of the camera. However, as I move the camera, it weaves around like it's my drunk uncle. Sometimes the controller even gets pushed through the floor.

I've definitely isolated it to those triggers. If I turn them off, the camera moves around just fine. And it's nothing inside the scripts either, I commented them out, and the weaving behavior continued regardless. So it really seems to be that the colliders are affecting the camera, even though the docs say they shouldn't be.

So what gives? What am I doing wrong? Why is the camera movement being affected by these sphere colliders that are set to be triggers?

Thanks for any help. Probably just something dumb I'm doing.

Comment
Add comment · Show 1
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 RonHiler · Sep 16, 2015 at 01:58 PM 0
Share

Well, I have more information, if anyone is interested or runs into the same problem.

I set up a new test scene. Just the FPS Controller (from Standard Assets/Characters), a scaled box acting as the floor (1000, 1, 1000), a few cubes to act as references, and about 100 empty game objects. On those, I stuck a sphere collider, checked the "IsTrigger" box, and set the radius to 100. I put those at various locations/elevations in the scene.

Oh, and I turned off the "Head Bob" on the camera so I could see more clearly what was going on.

Turned off the triggers, and walked straight as an arrow through the reference boxes. Turned them on, and I got pushed around. Just like in my scene. Absolutely no code, other than what is on the FPS controller.

So then I replaced the FPS controller with the other one that is in standard assets, which is "RigidBodyFPSController". And behold, the problem went away! Walked straight through the boxes, triggers and all.

So at this point I suspect there is a bug in the FPSController script that is causing the physics of the camera movement to be affected by triggers. I haven't tracked it down (and I probably wont, I wasn't planning on using that asset anyway, it was just a temporary placeholder until I write my own camera controller).

Perhaps this is a known issue, but I looked and didn't see any discussion about it. So if anyone runs into the same problem, it appears to be something in the FPS controller code. Either switch over to using RigidBodyFPSController or go debugging through that code (or write your own camera system, heh).

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

28 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

Related Questions

Enemy Trigger Colliders are triggering my player's trigger collider. Why? 1 Answer

Update meshCollider send OnTriggerExit 0 Answers

How to trigger functions like OnTriggerEnter2d and OnTriggerExit2d with raycasthit2d ? 1 Answer

triggered sound playing on start 0 Answers

How Do I increase speed based off of a trigger collider? 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