Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 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
1
Question by BrotherB · Apr 14, 2012 at 10:54 PM · camerabuttonsonmousedown

Mouse Click Dead Zone at Center of Camera View

I've made a series of buttons (objects with functions triggered through OnMouseDown which exist in the scene) for my game which are oriented at the center of the screen. This is a strange place for buttons, but the game takes place around the edges. I've noticed that all of the buttons work fine unless they are oriented at the center of the screen, as defined by the camera. Any button within a small radius from center screen does not respond to OnMouseDown. Move the button anywhere else and it works. Move the camera to where the center is different and whatever button falls under the new center will stop working.

I should expand this explanation to include that I am using Unity 3.5.1 on Win7 64-bit, and that OnMouseOver also doesn't work in the dead zone, which is how I first noticed it.

Really, this is just so weird that I can't reasonably expect a solution (though I'd be thrilled if there was one since this is such a nasty break in my game design), I'm just curious as to whether anyone else has experienced this.

Going to go redesign my button layout now. Good buy, two days of work!

UPDATE : I saved my layout! Apparently this only happens when the clickable object is greater than 40 units from the camera. I wont even question that, I'm just happy it works now.

UPDATE : I was unable to reproduce this effect in a newly made project, so I'm assuming that it was some strange combination of the way I did things in the previous one which caused the issue. A further reminder that making games is the most challenging game of them all!

-BroB

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by gregzo · Apr 14, 2012 at 11:29 PM

OnMouseDown does a Raycast for you automaticaly. The only thing I can think of is maybe you're using a character controller that interferes with it? From the docs:

Note: This function will return false if you cast a ray from inside a sphere to the outside; this in an intended behaviour.

Comment
Add comment · Show 3 · 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 BrotherB · Apr 14, 2012 at 11:38 PM 0
Share

There is no character controller, it's a board game. The camera is free floating in empty space.

avatar image gregzo · Apr 14, 2012 at 11:41 PM 0
Share

Hmmm, did you try a quick test, empty scene, cube in the "dead zone", simple debug?

avatar image BrotherB · Apr 14, 2012 at 11:48 PM 0
Share

Not yet. This project is almost done with a deadline of a few days from now. I found a workaround that works, so unless it rears its ugly head again in a new way, more thorough testing will have to wait. For now it seems having the object closer than 40 units from the camera fixes it, and the stress relief that came with finding that out was overwhel$$anonymous$$g. As soon as I have the time, I will build a scene specifically to measure the exact radius of the dead zone, if it carries over.

avatar image
0

Answer by meslin · May 01, 2012 at 07:16 PM

I have been having similar experiences with a dead zones using an OnMouseDown function. Could not find anything in the way, and tried moving the camera and object around....ended up just manually raycasting instead. I have an inkling of a suspicion that there is a real problem going on. No idea.

Comment
Add comment · 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

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

6 People are following this question.

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

Related Questions

How do I move the camera to another object in the scene on mouse down? 1 Answer

Reference to Camera/Player that initiates OnMouseDown 1 Answer

pressablebutton prefab not showing in camera,i am not able to see my prefab button in camera ? please any one help me 0 Answers

How to lerp between cameras on a UI button click? 2 Answers

Pass Clicks Through Camera 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