Hi,
When the avatar goes into a scene ( eg. a map), how to hide other avatar? It means that I cannot see other people and the other people also can't see me, but we are in the same room.
How to achieve this? I cannot find anything about this.
Thanks a lot!
How to hide the other avatar
Re: How to hide the other avatar
Actually I don't get the point in hiding the other users in a multiplayer environment.
Anyway, the most clean solution would be to make each user join a separate Room to which no one else has access. Of course all those Rooms (one per user) will be different Room instances on the server, but sharing the same server-side code (for example the Room extension).
A much more simple solution would be to use the iOpenSpaceAPI.getAvatarById() method to access the Avatar instance of the other users, and hide them in some way (for example removing the inner sprites from the display list). We can't guarantee this is bulletproof, because of course the OpenSpace engine is intended to be used in multiplayer environments.
Anyway, the most clean solution would be to make each user join a separate Room to which no one else has access. Of course all those Rooms (one per user) will be different Room instances on the server, but sharing the same server-side code (for example the Room extension).
A much more simple solution would be to use the iOpenSpaceAPI.getAvatarById() method to access the Avatar instance of the other users, and hide them in some way (for example removing the inner sprites from the display list). We can't guarantee this is bulletproof, because of course the OpenSpace engine is intended to be used in multiplayer environments.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Re: How to hide the other avatar
Hi,
Thanks for your reply. But I don't understand about this suggestion:"hide them in some way (for example removing the inner sprites from the display list)".
How to achieve this? Could you provide the API for this?
Thanks!
Thanks for your reply. But I don't understand about this suggestion:"hide them in some way (for example removing the inner sprites from the display list)".
How to achieve this? Could you provide the API for this?
Thanks!
Re: How to hide the other avatar
There's no API for this. In general, your avatar should be an instance of a custom class which handles the graphics displayed on the screen.
You could add your own method to make the graphics not being displayed at all.
You could add your own method to make the graphics not being displayed at all.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
Re: How to hide the other avatar
Hi Christina,
i did this for performance purpose and to build an player "ignore list user" with a very simple function wich loop on mapload and map change and change the visibility property (no loss of performances).
Check my previous posts there's one where i wrote this function, and if you found a better way please give us your solution.
i did this for performance purpose and to build an player "ignore list user" with a very simple function wich loop on mapload and map change and change the visibility property (no loss of performances).
Check my previous posts there's one where i wrote this function, and if you found a better way please give us your solution.
Return to “OpenSpace v2 discussions and help”
Who is online
Users browsing this forum: No registered users and 22 guests