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 Reloaded23 · Jan 31, 2014 at 09:56 AM · raycastcolliderdisablepop-up

if collider is disabled can i check click event on that gameobject?

Run time i am disabling gameobjects collider. Now when the collider is disabled and if i click on that gameObject i want to show some pop up message like "Error".

Is it possible?

Comment
Add comment · Show 4
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 Owen-Reynolds · Jan 31, 2014 at 04:26 PM 0
Share

Why are you disabling the collider? To let things pass through it, or to click on things behind it, or ... ?

As diggerJ writes, you need some sort of collider to get the click. So, depending, it might be possible to not disable it, but just "turn off" one part of it. Like, sometimes setting isTrigger is a cheap way to only physics-disable.

avatar image Reloaded23 · Feb 01, 2014 at 09:30 AM 0
Share

Once i click on that gameObject a pop up comes... So if that pop is active i don't want the user to click the gameObject... Once the pop gets closed i want the collider to be active again.

So if pop up is active & if the user click on that gameobject i want to show some error message

avatar image Owen-Reynolds · Feb 01, 2014 at 02:21 PM 0
Share

Oh, well that's just a basic program$$anonymous$$g problem. Ins$$anonymous$$d of disabling the collider, set something like usingPopUp to true. Ins$$anonymous$$d of re-enabling it, reset usingPopUp to false. Then, for each click, give the error/ignore if usingPopUp is true.

A first semester program$$anonymous$$g class usually shows this trick (using flags) midway through.

avatar image Reloaded23 · Feb 03, 2014 at 06:05 AM 0
Share

ok thanks. I did it using bool variable.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by diggerjohn · Jan 31, 2014 at 10:27 AM

I believe you would still need a collider to register a click, mesh or box or capsule.

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

20 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

Related Questions

How to use a Raycast to see the distance traveled within a collider. 2 Answers

Move player to specific location and avoid obstacle. 2 Answers

Im trying to create a word game with a twist 0 Answers

Raycast not detecting ANY HITS AT ALL when starting inside a collider. 0 Answers

ball sometimes goes through the bat when hit... collider problem... How to do a Raycast? 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