Hey,
I followed Sebastian Lague’s tutorial on how to make a 2d platformer, up to the third episode. It runs just fine… until I unplug my laptop from it’s charger. Then, the player moves in the opposite direction, at a slower, more jittery rate. Since the tutorial used a raycast-based system to determine collisions, I was wondering if maybe raycasts acted differently when the computer is in a low power mode, or someting to that effect? In any case it doesn’t seem like it should be happening.
You might want to check your power saving settings as on laptops they usually throttle down some components when unplugged by default - such as the graphics card which is responsible for raycasting (and a lot of other stuff when talking about games).
Try setting it to max performance and see if that changes anything.
I think I fixed it, though the problem seems kinda odd. In the tutorial the raycasts were offset by the horizontal velocity, when they were cast vertically. I’d just copied that code and modified it to do horizontal raycasts, too, and gravity was causing them to constantly be pulled into the ground. Still don’t get why that acted differently between power modes, but it works now so no issues here.