Amerio.Stephane Posted June 10, 2020 Share Posted June 10, 2020 Hello, We have a scenario with multiple PlayerSpectator placed in the world, and the user can select witch one is the active one (ie the one he is seeing through and controlling with the mouse). The problem is: they all respond to the mouse and keyboard events! (even when they are not the one set with Game::setPlayer()) Is it possible to "lock in place" all but one PlayerSpectator? Ois there some way to select which one will receive keyboard/mouse events? Or are we totally doing this wrong? Link to comment
morbid Posted June 11, 2020 Share Posted June 11, 2020 Hi, We never encountered such behavior. Could you please provide a sample or code snippets used for player management? Thanks. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Amerio.Stephane Posted June 11, 2020 Author Share Posted June 11, 2020 Confirmed in 2.10: create a TestSpectator new project with default settings (no plugins) add two PlayerSpectator A B add some dummy cubes or whatever as children of these spectator (just to see the movement of the spectators) For the B spectator, set min&max velocity to 0, and turning to 0 Save and Run When you move or rotate your player, the A spectator will also move and rotate, B will only rotate (so setting "turning" to 0 had no effect on it) See attached world. TestSpectator.zip Link to comment
morbid Posted June 16, 2020 Share Posted June 16, 2020 Hello Stephane, I apologize the answer took too long. You experience this players' behavior because the controlled flag was enabled. This flag makes all players to receive a user input. To fix this uncheck "Controlled" flag in the editor or use isControlled/setControlled methods. Sorry for the inconvenience, we'll update the docs. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Amerio.Stephane Posted June 16, 2020 Author Share Posted June 16, 2020 Yes, the controlled flag is the solution! Thanks for highlighting this :) As a side note, shouldn't setting "turning" to 0 also somewhat impede the rotation of the PlayerSpectator? In my test, I see no difference. (or did I misunderstand its usage) Link to comment
morbid Posted June 16, 2020 Share Posted June 16, 2020 Turning affects turn performed by the arrow key only. That should be in the docs as well, will do. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts