Checking the location of a section of code

When going through the lesson with working in the for the Mover.cs script. I saw that I had a section of code that looked to have to be in a different script. Though I am at a lose on when that script lesson was.

What did we have a struct made looking like this for, and what script was this supposed to be added to?
[System.Serializable] struct MoverSaveData { public SerializableVector3 position; public SerializableVector3 rotation; }
Or was this supposed to still be in Mover and I am missing something?

This struct has to do with saving the position and rotation of the character.

You would use this struct to save both position and rotation rather than simply returning/restoring a SerializeableVector3 for the position. This is optional (in fact, saving the rotation for AI Controlled characters would be pointless as the AI will take over and adjust rotation as conditions warrent).

So I can remove the struct then as it wont have any real need if the AIController handles all that instead

That is correct.

Understood, thank you.

I am curious unless I am overlooking is all the code from lesson to lesson saved right where we leave off from the lesson before or are there times of small changes and updates in-between lessons?

Are you referring to the codebase on GitHub? Each commit is generally at the end of a lesson, though there are times when a lesson was edited later, and these changes may not be reflected in the lesson commit.

I am more referring to the codebase going from lesson to lesson. Not the GitHub commits. As we focus on a topic in the lessons sometimes I see that the scripts changed in-between lessons either for removing code or comments that no longer need to be there to continue with the lesson. For me it is a little confusing as I will think if I missed something and will go back to check. But I am slowly getting better at recognizing this though so as I continue on I should no longer continue to have this problem.

This can also be from retakes or changes made along the way. This first course was “released” at the same time that it was being recorded, with lots of feedback along the way. There were a couple of “wait, this might be a better way” moments, and re-records.

That makes sense, with this in mind I should have less confusion on my part as well with looking at code differences and have a better understanding with following along. Thank you!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms