Add an output to the Controller Sensor which pulses when the user re-centres their Imp
I've been working on gyro based first person controls recently. Due to the nature of motion controls, it's necessary for the user to re-calibrate from time to time.
With the motion output from the Controller Sensor, when Options is held to re-centre the Imp, the values of pitch and yaw are reset to 0, which assigns the current position as the neutral point (even when the Imp isn't being used). This is fine on its own, but the system I'm using has aim sensitivity modification (such as aiming down sights). This affects the neutral point in relation to how I'm interpreting the motion value, and inevitably puts the camera in the wrong position after holding Options to re-centre.
By knowing when the user re-centres their Imp, I can always reset the camera direction to the correct point on the y-axis horizon. I can also ensure the x-axis camera rotation doesn't change from its position before the reset, which is my preferred input design for user re-calibration while using my control system.
Since I have no way of telling when the user is holding options, I must look for a secondary signal: the pitch and yaw outputs from the Controller Sensor changing to 0. My current method is to see if these values have been maintained for a minimum of 2 frames. I feel this is less likely to cause an accidental activation than 1 frame. However, from testing, unwanted activations can still occur, albeit rarely. Adding more frames would make it safer, but to the detriment of the user experience, with more / longer lasting judder from re-calibration.
If I had a pulse signal from the user re-centring their Imp, then my re-calibration would be frame perfect, with no possibility of unwanted activation. I would appreciate a lot if this could be added to the Controller Sensor as an output.
I think it works because numbers in the game can go to 7 or 8 decimal places, whilst the comparator calculators only look at the first 2 decimal places.
Oh smart. Also... WHY DOES THAT EVEN WORK?! XD
Just a general update regarding this, while it would still be nice to have a direct input from when the user resets their Imp, I was able to greatly improve my workaround method.
What I did was multiply my input values by 1000. Now my '= 0' calculators are much more precise, and are far less likely to activate accidentally. Knowing how to improve the precision of comparator calculators is pretty useful going forward.
It only needs to be two axis at 0 to reset, because roll always uses gravity as a reference, so it doesn't change to 0. Accidental activations are especially common just after re-centering if you're doing small movements.
I would've thought it would be insanely rare for X Y and Z to be 0 by accident... how are you even doing that? XD
Would be a useful output I think.