• 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 AviKohl3D · Sep 15, 2016 at 01:43 AM · colliderstriggers

3D triggers not detecting rigidbody

I'm just trying to build a simple trigger detection script but the basic trigger system is not working. Not even the debug messages in the script show up in the console. I've tried with a box collider trigger and a sphere collider trigger (making sure "Is Trigger" is checked of course). The entering objects always have a rigidbody component. So what is the obscure "X-factor" not covered in documentation and tutorials that's got me stymied?

 using UnityEngine;
 using System.Collections;
 
 public class TriggerScript : MonoBehaviour {
 
     void onTriggerEnter(Collider other)
     {
         Debug.Log("Object entered trigger");
     }
 
     void onTriggerExit(Collider other)
     {
         Debug.Log("Object exited trigger");
     }
 
 }






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

Answer by Cepheid · Sep 15, 2016 at 01:55 AM

Hi @AviKohl3D

The problem you're facing is as simple as a typo. You've misspelled the OnTriggerEnter methods. Every method name provided by Unity's base MonoBehaviour must be typed in Pascal case. So, just change your "onTriggerEnter" to "OnTriggerEnter" and you're good to go!

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

70 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 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 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

respawning with triggers in unity,How do i make only my player respawn? 0 Answers

3D Trigger collider slows player moved by forces 0 Answers

onTriggerEnter returns wrong object's attribute 1 Answer

multiple objects with triggers that need to ignore the triggers but still collide with eachother? 0 Answers

two colliding objects effect a third object 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges