Hello,
I am currently working on a platformer for a friend, and since I have the basics of the player movements I wanted to let him test it out. However, when I build the game for Windows I couldn’t move my player!
I’ve been searching for well over 2hours now and I’m not managing to figure out where the issue is…
My player uses the new input system to move, and these are the actions I put. The left/right, as well as the up/down, are 1D Axis, and the MoveLeftRight and MoveUpDown are both Values with Any as the control type. It is my first time really using this new input system so my first thoughts were to look in here to see if I had messed up something. I didn’t see anything wrong, but maybe I missed something…
Then I tried adding a script to get the console logs in build… But it only kept posting this one: “NullReferenceException: Object reference not set to an instance of an object” over and over. While trying this, I realized that even though I can’t jump or move in any direction, the switch action is working fine (switches between two characters’ data from Scriptable objects added on a GameObject in the scene).
Seeing this was the error I added some debug.logs absolutely everywhere to find what was null in my scripts… But nothing came out…
My next idea was to put the debugs in the functions called by the input manager, to see if they were actually getting called or not. Each one of them was called without issue, and I even checked the values that they were getting, and everything is normal.
So… Now I’m back to square one, not really seeing what I messed up… Since I’m not getting any errors in the editor and it’s working perfectly there, I must admit I’m kinda confused.
I’m not sure if my movement code can really help figure this out, but I’m basically using a simple rigidbody2D movement mechanic.
Also, while testing in the editor I realized that the inputs for a gamepad stick weren’t giving me the right values. I don’t know if it’s linked or not, but the gamepad D-Pad was working flawlessly, just like the keyboard, while the Left Stick only worked once in a while and gives like top-movement values instead of right-movements, etc. I tested this gamepad on another project yesterday and everything worked well with the Left Stick, so I assume it’s something from my input actions, but I’m not sure of anything right now…
So yeah, basically, if one of you had any ideas on where I might look to fix this issue, it would be greatly appreciated (and if you had an idea for the gamepad issue, if it’s not related to the first one, it would be great too!)
Thank you!