Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
This question was closed Jan 25, 2016 at 06:40 PM by tothetapp for the following reason:

The question is answered, right answer was accepted

avatar image
1
Question by tothetapp · Jan 24, 2016 at 09:55 PM · androidtriggernot workingdevice

OnTriggerEnter works on Unity Editor but not in android device?

Why OnTriggerEnter works in the editor but not in a phone?I'm using unity 5.3

Comment
Add comment · Show 7
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 SterlingSoftworks · Jan 24, 2016 at 09:57 PM 0
Share

Could you give us either a screen shot or a snippet of your code? This is not enough information for somebody to help you out.

avatar image tothetapp · Jan 24, 2016 at 11:17 PM 0
Share

void OnTriggerEnter(Collider col) {

         {
         
         if (col.gameObject.tag == "pointlight")
         {
         Destroy (col.gameObject);
                   }

}

I have this attached to the Player..player has a rigidbody and a collider

2.png (88.3 kB)
avatar image SterlingSoftworks tothetapp · Jan 24, 2016 at 11:22 PM 1
Share

Hmm.. Okay, nothing wrong there.

What about at the top of your script, do you have using UnityEditor; ins$$anonymous$$d of using UnityEngine?? That could cause it to only work in the editor and not in the engine.

Or, are there any of your objects' tags "EditorOnly"? This can also cause stuff to work in the editor, but not a build.

avatar image tothetapp SterlingSoftworks · Jan 25, 2016 at 06:39 PM 0
Share

Fixed!It was only that I used two different projects and the tags weren't registered .. Thanks ;)

Show more comments
avatar image hunter_m · Jan 29, 2016 at 12:02 PM 0
Share

i have the same question. The collision worked fine on the game view in unity, but it does not work on android and ios.

if u find the way to fix it, plz tell me, thanks

avatar image tanoshimi hunter_m · Jan 29, 2016 at 12:08 PM 0
Share

They have fixed it - see the comment 3 days ago that says "Fixed!"

1 Reply

  • Sort: 
avatar image
1

Answer by droni · Jan 25, 2016 at 01:18 PM

I think the gameobject is a fail try col.tag == ...

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

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

transform.position working on Unity editor but not on Android phone? 1 Answer

Bluetooth controller works in the editor but not on a android device 0 Answers

Save script not saving data on android device 1 Answer

Unity Remote 5 not working on my Nexus 6 - Marshmallow. 0 Answers

Trigger not working with a specific game object 1 Answer


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