Search Unity

Bug OnEndDrag not being called when hosting

Discussion in 'Netcode for GameObjects' started by rbitard, Dec 23, 2022.

  1. rbitard

    rbitard

    Joined:
    Jan 11, 2022
    Posts:
    197
    Hello, I found a little bug
    When my game object that implements

    MonoBehaviour,IBeginDragHandler,IEndDragHandler,IDragHandler

    is dropped on a Network object that implements NetworkBehaviour, IDropHandler

    The OnEndDrag method isn't called.

    While on a client, OnEndDrag is called
     
  2. rbitard

    rbitard

    Joined:
    Jan 11, 2022
    Posts:
    197
    I can't reproduce with a simple example, it might be more to it
     
  3. rbitard

    rbitard

    Joined:
    Jan 11, 2022
    Posts:
    197
    It's because OnDrop does stuff that leads to destroying the Draggable component before it has a chance to trigger OnEndDrag. Still odd because on the clients it works fine
     
  4. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    440
    Hi @rbitard , could you please open a bug report using this link? it'd help the team to have a look at it with clear repro steps. It'd also be interesting to understand if this is actually a Netcode for gameobjects bug or something related to your specific script logic.
     
    rbitard likes this.
  5. rbitard

    rbitard

    Joined:
    Jan 11, 2022
    Posts:
    197
    RikuTheFuffs-U likes this.
  6. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    440
    rbitard likes this.