Hello there. I began encountering/noticing this issue at the end of this lecture (though it very well may have started when we began this refactoring. I have ‘resolved’ it after a fashion, but it feels like a bad workaround and that there is probably a better way to do what I have done to fix it, and if there’s not, here’s hoping I save someone else the several hours of confusion.
The Issue: Karts no go!
So after finishing up this lecture I found that my karts wouldn’t move forward (And the autonomous proxies were spawning up against the wall all jittery). Quite confused I spent some time trying to figure out what the heck was going in. Using UE logs I realized that the inputs were still working, but the cars weren’t moving. Eventually I tracked it down to the Kart’s Movement component.
Here’s how it should look in the editor.
While what I had showing up was more like this, (Except it didn’t have the little yellow reset to defaults arrows, I took this capture afterwards, and it is for example purposes only.)
So what I found was that my Kart’s Movement Component was defaulting all the member variables values to 0. I tried changing the ordering of the variables, As you can see in my screencaps, I ended up leaving rolling resistance on the top. That didn’t work. I then tried to change the values and recompile, that didn’t work either. I restarted both visual studio and the UE4 editor, as well as rebuilt the solution for my visual studio from inside unreal and none of it did a thing to fix the problem. What I ended up having to do was to make a whole new blueprint child class from the cpp gokart, and then when I deleted the old broken one I used the built in auto-rereferencer in UE4 to fix up my stuff so it was the default pawn to spawn again. The new BP_UnBorkedKart works as intended, and I can move on to the next lectures, Hooray! But I still have no clue why this happened.
What I want to know is how/why did this happen? What is the best way to fix it?
I feel like I need to learn a better way to sort this out in the future. If I had done a lot of work in both BP and CPP combined on this actor I would have been in much worse shape trying to just remake it from scratch, and I’m really hoping there’s just some switches/levers/buttons in the UE4 editor I could have pushed to resolve this and I simply didn’t know about them.