So im trying to activate my spike trap animation when my player walks over it, but it doesnt seem to activate , the player is correctly tagged “Player” and the script appears to be correct.

Forum Archive So im trying to activate my spike trap animation when my player walks over it, but it doesnt seem to activate , the player is correctly tagged “Player” and the script appears to be correct.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7223
    edward mitchell
    Participant
      #26712
      Jonathan Gonzalez
      Participant

        Well it could be a few things. First, I would ensure that your OnTriggerEnter is being called properly. Add something like this 

        Debug.Log(“Player entered trigger zone”) 

        within the OnTriggerEnter “if statement”. This will appear in the console if it’s properly detecting the player entering. Note for this to work properly, it needs three things:

        • Collider 
        • Tag of “Player” on Collider object (or any tag you specify)
        • A Rigidbody (kinematic or non-kinematic)
        If all that works properly, then it’s time to check the animations. First, make sure everything is spelled properly and you’re using case sensitive names. If you wrote “playSpikes” for your parameter but have “PlaySpikes” for your script it won’t work. Also check to see if your transitions are working properly. If you’re still having issues let me know. 
        #26713
        edward mitchell
        Participant

          I may have figured it out , didnt know that when you tag something it doesnt tag the children , may have caused the animation not to play .

        Viewing 3 posts - 1 through 3 (of 3 total)
        • The topic ‘So im trying to activate my spike trap animation when my player walks over it, but it doesnt seem to activate , the player is correctly tagged “Player” and the script appears to be correct.’ is closed to new replies.