Jump to content

All PlayerSpectator react to kb/mouse


photo

Recommended Posts

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

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

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:

Link to comment

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
×
×
  • Create New...