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 Larry-Dietz · Jan 02, 2012 at 06:20 AM · collidercharactercontrollermouse

Mouse events for object with character controller

I am trying to use OnMouseEnter and OnMouseExit in a script attached to an object with a character controller.

This doesn't appear to work. I cannot add a collider to the object without losing the character controller, which I need on the object.

I tried adding a box collider to a child of the object, but that didn't work either.

Does anyone know of a workaround to make this work?

Any help is greatly appreciated. -Larry

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
0
Best Answer

Answer by roamcel · Jan 02, 2012 at 01:43 PM

I don't seem to be able to -not- get this to work. This actually works with a single character controller standard collider, and with a different custom collider.

I'd suggest you start over from the example here: http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.OnMouseEnter.html

IMPORTANT: DOES NOT WORK ON IPHONE.

Comment
Add comment · Show 1 · 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 Larry-Dietz · Jan 02, 2012 at 04:45 PM 0
Share

I will start over from that example, and see if that makes any difference. The object is really simple. Just a prefab containing a model with only a character controller attached to the prefab, and the script that I was trying to get the mouse events in.

The script contained only an On$$anonymous$$ouseEnter and On$$anonymous$$ouseExit with only debug.log lines in the body of the method, and they just never hit.

I will dig through the docs again, and see if I can figure out what I possibly could have done wrong.

Thanks for verifying that this should work, so I know I am not just spinning my wheels :)

-Larry

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Can a CharacterController ignore one or more Colliders? 2 Answers

OnCollisionEnter Push Object Problem 0 Answers

Why won't my box collider collide? 4 Answers

CharacterController had no enabled property 1 Answer

Character Controller Object Randomly Falls Through Colliders 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