Inconsistency in User Room Events

Whenever i am trying to listen to User Join Events, its coming properly but whenever I am trying to listen to the userLeftRoom Event its not listening to the event.

this.context.connection.beginListen(RoomEvents.UserLeftRoom,()=>{
console.log(“Someone Left”);
})

is there some Specific way to implement this?

Original Post on Discord

by user 406778568597831690

Hi, no this is how it works but it may take a few seconds until the server has realized that the user has left

I am getting the log from Engine scriprt but i want to receive the event in my script so that i can do some activities based on that it’s not working in my script. Script is attached to instanciated gameobject

by user 406778568597831690

I’m not sure what you mean - can you show some of your code?

Sure i am trying it this day
image.png

by user 406778568597831690

its still not working

by user 406778568597831690

Hey, do you think you could send us a bug report with your current setup? :slightly_smiling_face:

Found out that it is unbale to listen to the User Leave events on Instacniated Scripts

by user 406778568597831690

Thanks for the update. That should really make no difference. When the script is in the scene at start it works as expected?

Technically it should but it doesn’t. however can we create and subscribe to events or implement Delegates or UnityEvents in typescript if so how ?

by user 406778568597831690

Sure you can. The code above is already containing 3 lines subscribing to events. Read more about it here: Typescript Essentials | Needle Engine Documentation