OnTriggerEnter2D

NodeCanvas Forums General Discussion OnTriggerEnter2D

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #9338

    Hello.

    I’m trying to use OnTriggerEnter2D and OnTriggerExit2D to enter and exit a state in a FSM, and keep getting this warning. Any ideas what might be causing it?

    Method ‘OnTriggerStay2D’ not found on subscribed type CheckTrigger2D
    UnityEngine.Debug:LogWarning(Object)
    NodeCanvas.AgentUtilities:Send(String, Object) (at Assets/NodeCanvas/Core/Other/AgentUtilities.cs:154)
    NodeCanvas.AgentUtilities:OnTriggerStay2D(Collider2D) (at Assets/NodeCanvas/Core/Other/AgentUtilities.cs:72)

    #9339
    Gavalakis
    Keymaster

    Hello,

    Yes, I’ve forgot to remove listening from OnTriggerStay2D in the codintion when I did some refactoring to that.
    Please open up CheckTrigger2D and in lin #9 remove the “OnTriggerStay2D” from the parameters of the EventListener attribute:

    This:
    [EventListener(“OnTriggerEnter2D”, “OnTriggerExit2D”, “OnTriggerStay2D”)]

    To this:
    [EventListener(“OnTriggerEnter2D”, “OnTriggerExit2D”)]

    Thanks for report 🙂

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.