[Lance] What is the best way from grabbing information from a listener and getting it to the game engine? Currently trying to make the Spaaaceship follow my mouse. I have made a MouseControls.js that listens for mouse movement and records the X and Y of the cursor. I then used the following code in the client engine to get it to the game engine
this.sendInput('mouseMove', {
cursorX: this.mouseControls.cursorPos.cursorX,
cursorY: this.mouseControls.cursorPos.cursorY
});
then in game engine I tried reading the second parameter in the processinput method like so:
inputData.inputOptions.cursorY
but I get the error "Cannot read property 'cursorY' of undefined". I get that each key for the other controls does the same thing every time, but I don't know how to pass variable information around (cursorX/Y). This is all modifying the spaaace tutorial btw. Should I be making a mouse object instead?
UPDATE: I have dug deeper and learned a bit more, so I think I have narrowed down my problem. It is as follows:
At the moment the game engine processes the inputs, it only has the name of the input with no additional information, which is fine for key presses that do the exact same thing every time. However, with the mouse movement, once I receive the "mouseMove" input, I also need to get the mouse X and Y position from my Mouse Controller, which isn't visible from game engine (as far as I can tell). So how do I get those values in that moment?
Since you cannot see my code, it is the equivalent of getting the "activeInput.up" value from KeyboardControls from GameEngine's processinput method