Summer Work (Day 3)

Slow Progress


    Continuing on the "tutorial", I tried today to get the function calls working so that I could get the planets moving. I decided to do this in the gamemode. Basically I needed two functions to be called on tick that would update the velocity and position of all planets.
    The first challenge was getting a gamemode at all. When I first started trying to create a new gamemode, the editor would crash every other compile. I realized that there were some updated made to the source code, so I downloaded and built that. Immediately after that the editor was crashing every compile. I spent some time trying to debug this but eventually it managed to fix itself and I haven't had a crash since then. I created a CelestialGameMode and a blueprint child. The next challenge was to get a variable for the gravitational constant that all planets could access to calculate the force that should be applied to them. It took me some messing around but I got it working. This process also made me learn the casting syntax for C++. 
    After that, it was on to the functions. This is what stumped me. The first thing I had to do was get all planets in the scene; a simple task in blueprint. It turns out it was much harder than I thought. For whatever reason I could not make an array of type CelestialBody. No matter what I did it wouldn't compile. It kept giving me the error: "'ACelestialBody': undeclared identifier". I even #included the Celestial body script and still no change. As soon as I figure this out though I think it will be easy (but that's what I thought before this so who knows).

Comments

Popular posts from this blog

Polishing the Foundation

Progress Update #13

A New Chapter