BeanstalkBlue Posted March 12, 2017 Share Posted March 12, 2017 I have read all of the camera inputs articles in the docs and I have tried to find a demo, but I can't seem to figure out how to add inputs to control objects other than the camera in Babylon. I have tried to manually add a keyboard event listener following Temechon's Infection code, but that doesn't work, as it interferes with camera input (either camera input will work or my inputs will work, but not both at the same time). Here is part of Temechon's code from https://github.com/Temechon/infection/blob/master/ts/Player.ts // Keyboard events this._handleKeyDownCall = this._handleKey.bind(this, 1); this._handleKeyUpCall = this._handleKey.bind(this, 0); window.addEventListener("keyup", this._handleKeyUpCall); window.addEventListener("keydown", this._handleKeyDownCall); Should I instead just implement my own ICameraInput and then put all of my game controls inside of this? It feels strange to have all game input inside of the camera. The controls don't control only the camera. But is this what Babylon experts usually do? It seems like this could create a problem when you switch from one camera to another. Is this meant to be done with the ActionsManager? Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.