Orientation doesn't reset properly?
-
The switch doesn’t have a magnetometer, It just has gyros and an accelerometer, and gyros drift. That means a recalibrating button press like this is basically a necessity for splatoon/zelda type gyro aiming. I bet it’s just a couple of lines of code though - get a value when you press the button, then do something something and don’t use c.orientation directly, have an adjusted value based on what came up when the button was pressed, type of thing..
-
@toxibunny I tried that with pogo Jo didn't work to good ended up telling the user to dock the control which resets the calibration not really ideal if your playing on the telly though.
-
That's right
It returns a value between - 1 and 1 so if you add 0.5 to that you can't access the the final half of one side. -
Hmm, I did the same thing, with the same bad results. The ’something something’ isn’t just adding/subtracting the calibration point value.
I had felt it would be something fairly easy though - How long did you spend on it?
-
I wonder if you could just do:
C.orientation[0].x = 0
Maybe that'll reset its value?
You'd just have to do it for every value for both joycons. Or make a function that you can pass each joycon value in to -
That would just set it to 0 though until you read the inputs again, probably.
Sine waves repeat. If you added your calibration value, then converting it to an angle and back again should get you back to something between -1 and 1 again, right?
-
@toxibunny quite a while gave up in the end and put touch controls in the game which if i had of started with i probably wouldn't have tried the motion control.
When they worked they were all right but you needed to sit in a swivel chair in the end !! -
@toxibunny I tried that too with the angle and some others didn't try setting to 0 though worth a try
-
Yeah, there’s something going on here I don’t understand. Checking with the ’better joycon test’ shared in the big code sharing thread (I think), and just having my controller flat on the table, then spinning it slowly so it stays flat, 2 of the orientation values change where I would have expected just 1 to.
Can someone from the team comment on what those values are supposed to represent, and whether or not it’s working as expected?
-
Ah, okay. The 2 changing values are offset by 90 degrees, meaning I can do something sensible with them. I’m still not really getting it though. I have done a thing that uses objectPointAt to try and help visualise it. Putting the controller flat on the table and spinning it works great, but otherwise I dunno what’s happening - share code NXPWG9NDS3 . Currently pending. I’d appreciate some insights, if anyone has time to take a look :)