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 /
  • Help Room /
This question was closed Jun 18, 2016 at 07:49 AM by Hellium for the following reason:

Duplicate Question

avatar image
0
Question by matioma · Jun 18, 2016 at 05:46 AM · c#trigger

Problems with triggerEnter()

Hi. I want My game object to enter trigger object and t change his target to the next trigger point.But when he enters the trigger it does nothing.

using UnityEngine; using System.Collections;

public class MOvement : MonoBehaviour { public GameObject target;

 void Start () {
 
 }
 
 void Update ()
 {
     transform.LookAt(target.transform);
     transform.Translate(0f,0f,1f);
 }
 void OnTriggerEnter(Collider col)
 {
     if(col.gameObject.tag == "PathPoint" )
     {
          Debug.Log("gg");
     }
 }

}

object target already has tag "PathPoint",and it's collider is trigger.I don't understand why it doesn't work

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 JedBeryll · Jun 18, 2016 at 05:55 AM 0
Share

Does any of them have a rigidbody?

avatar image matioma JedBeryll · Jun 18, 2016 at 06:26 AM 0
Share

it's not ONCollision enter so it it must work,in same project i used on trigger enter but at other gameobjects it works but with that example it doesn't.What can cause such problems?

avatar image JedBeryll matioma · Jun 18, 2016 at 06:30 AM 0
Share

https://docs.unity3d.com/ScriptReference/$$anonymous$$onoBehaviour.OnTriggerEnter.html

Notes: Trigger events are only sent if one of the colliders also has a rigidbody attached.

0 Replies

  • Sort: 

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

Change Scene with Physics Raycasting 1 Answer

How can I collect collider2Ds(Trigger) the player is in into an array 1 Answer

Weird text field bug? 1 Answer

Object reference not set to an instance of an object 0 Answers

touch to activate animation 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