I am utterly stumped on this one.
For some reason, a particular enemy type in my game will not update its velocity.
My code simply declares “rBody.velocity = newVelocity;” and I’ve verified through debug.log that the newVelocity is properly updating its value on each update. And clearly it is finding the rigidbody because there are no null reference errors popping up in my log. This is the last thing in my update function, and when I add debug.logs after it they get called, so I know this command is being received.
But this enemy just floats in the air where it was spawned. And when I look at it in the inspector, the “info” listed in the Rigidbody2D continues to show the velocity as 0,0.
I cannot find anything in my scripts that could account for this behavior. What am I missing? Is there some setting I must have neglected to check?
I don’t have problems with my other enemies nor my player, just this one enemy type.
It used to be working fine with my original version I had made many years ago in Unity 4. This is a problem I’ve run into after porting my game to the latest version of Unity. But I can’t find any setting that got screwed up in the conversion, and as I said, the other characters in my scene are working just fine.
I’m at my wits end. Anyone have any thoughts of what I need to check?