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
2
Question by Cyriel · Jul 17, 2010 at 03:10 PM · animationrigidbodycollidertrigger

Trigger via Collider

Hello,

I have tested a script that triggers an animation via a collider. And it worked pretty well. However, when i put the same script on my character, wich has a rigidbody. It doesn't work. I changed the tags and names. It looks ok to me. but it just doesn't respond. Even the print-message don't work.

I also tried to add an capsule-collider. But that doesn't work either. Anyone had the same problem? I can't figure out what's going wrong. I DO get the message "NullreferenceExecption. But i can't see what's wrong. Any idea's?

Comment
Add comment · Show 3
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 Mike 3 · Jul 17, 2010 at 03:16 PM 0
Share

You'll need to post the code - NullReferenceException means you're doing something on an object which hasn't been assigned to, which is usually wrong

avatar image Cyriel · Jul 17, 2010 at 03:28 PM 0
Share

I just got the detection working. turned out i had the "target" on my script set to the model. But when i put it to "None" it worked fine. I'm sorry i posted this question for nothing, but maybe it can help out others..

avatar image Ashkan_gc · Jul 17, 2010 at 04:03 PM 0
Share

so answer it yourself.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Ashkan_gc · Jul 17, 2010 at 04:04 PM

many times the problem is not where you think. the other parts of the code has problems. if users post their codes it can be detected by others.

sometimes when you have rigidbodies your colliders are not trigger (i.e their is trigger is off) so OnTriggerEnter don't work and you should use OnCollisionEnter or make the collider a trigger.

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 Cyriel · Jul 17, 2010 at 05:01 PM 0
Share

that makes sense.. Thanks !! :) i'll keep this in $$anonymous$$d!

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

No one has followed this question yet.

Related Questions

Possible to stop collider from "popping" through plane when re-centering? 2 Answers

Having a door dissapear once a key is collected 1 Answer

How do I make the enemy ai animations play after the player exit the on trigger collider on the enemy ai 0 Answers

Picking up items with Rigidbodies 2 Answers

Moving kinematic rigidbody trigger against kinematic rigidbody 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