So I was working on a 2D plat-former project yesterday and I I made 2 changes to it. the first was adding the ability to crouch to the game and the third was I wanted to try an different collider. I updated the 2d collider from polygon to square to compare the two and suddenly the character would no longer move. This includes gravity not applying to the character for some reason.
I have removed the rigidbody2d and re-added it back in several times,
taken out the 2dbox collider and swapped back the polygon collider,
commented out my code for the player controller thinking something unknown error in the code may be effecting the character and the character still just floats in midair like gravity isn’t a thing,
checked the settings on the 2d collider and the gravity scale is 5 and mass 1
updated unity from 4.6 something to version 5 - this let gravity work again but then the character started to slowly rise up int he air after dropping to the ground.
after searching online for the new problem it turns out the setting on the animator apply root motion was selcted and unchecking this caused the character to no longer float int he air. however now the character is floating again and gravity no longer affects him and he still doesnt move. animations for walking and running work but GetComponent().velocity = new Vector2 (movementSpeed, GetComponent().velocity.y); doesn’t move the character. Also I’ve checked to make sure movement speed is still defined as 5.
Any ideas? My GoogleFu is not coming up with anybody else with similar issues previously and my own trouble shooting skills seem to be exausted.