We've added a feature that allows you to receive a callback when someone starts following you while playing together in the world.
Make the most of this feature in social content!
Caution
- This feature is available from World SDK version 1.21.21 and ZEPETO.Module version 1.0.11 or higher.
- It is applicable in worlds with multiplayer functionality.
- You can check the room member list screen in the ZEPETO mobile app.
Please refer to the following sample code for how to use the callback of SocialService.onRoomMemberStatusChanged
.
- This is an example of printing User ID and following status to the console log when the following status of the room member list changes within the world.
import { RoomMemberStatus, SocialService } from 'ZEPETO.Module.Social';
import { ZepetoScriptBehaviour } from 'ZEPETO.Script'
export default class SampleScript extends ZepetoScriptBehaviour {
Start() {
SocialService.onRoomMemberStatusChanged += (userId: string, status: RoomMemberStatus) => {
console.log(`onRoomMemberStatusChanged: userId = ${userId}, status = ${status}`);
}
}
RoomMemberStatus
Enum | Desciption |
---|---|
None = 0 | When a player in the same room is not following the local player |
Following = 1 | When a player in the same room is following the local player |
Blocked = 3 | When a player in the same room has blocked the local player |
If you run the sample code above on mobile, you can see that the console log is called every time the following status changes on the room member list screen.