- Home /
Issue with animator and Triggers
First off, the game is in 2D. So the problem is that having an animator component on a GameObject seems to prevent it from detecting collisions. I have a GameObject which has a RigidBody2D, a BoxCollider2D, and the following script: using UnityEngine; using System.Collections;
public class CollisionStuff : MonoBehaviour {
void OnTriggerEnter2D(Collider2D coll){
Debug.Log ("trigger detected");
}
}
The other GameObject also has a RigidBody2D and a CircleCollider2D, and is a trigger. When the animator component is left on the first object, the debug log never happens.When the animator component is removed,the trigger is detected. Anyone know a way around this?
if you think that problem in animator and if animator in same gameobject as rigidbody and collider try move rigidbody with collider to child gameobject or parent.
Same problem here. If I disable the Animator component the trigger is detected but if its enabled it is not detected. If I put a controller with a rotation animation in the Animator component the trigger is detected, but if I put a controller with a rotation and resize animation in the Animator component the trigger is not detected.
I think the problem might be in the resize of the game object. I am using a polygon collider 2d.
Any clues?
Your answer
Follow this Question
Related Questions
Unity2D Sync falling object with animation 0 Answers
Animator Condition Not Working 0 Answers
Starting a 2D animation on a trigger 1 Answer
animation script for 2D platformer issue 2 Answers
Display 2 animations with same Animator in a 2D game 0 Answers