Short one again. But, hey - progress is progress, no matter how small.
Last time, I was researching if it was possible to load a shape and control it from one script rather than create a script for each individual object. I was leaning yes, and after successfully doing this with one object, I'm thinking I will be able to do it.
I had successfully spawned my shape onto the scene. Pretty exciting! Considering that my knowledge of programming has been pushed way back in my head, this is practically a miracle. After a quick refresher and finding relevant posts about my issues, I was on my way.
Previously, my code looked like this.
Unfortunately, this was not right. My issue at the time was figuring out the syntax for rotating the object to see the different sides of the shape. I thought my problem was that I was using the wrong code to move the object, but it was actually my initial code.
As you can see above the Instantiate code does in fact make my shape appear. But that's it! When I tried to use my 'shape' variable to rotate the shape being spawned, nothing happened because that variable wasn't actually referencing anything. This is one of the first and most basic concepts you learn in programming. Oopsies. See what I mean by needing that refresher?
So after that palm-to-head smacking incident, I fixed it. Now it looks like this.
In one line, I am referencing my shape, and in the other I am making it appear and getting it's rigidbody component. The rigidbody is essentially what gives it physics. That's another thing I needed to do: update all my shapes to have this physics component.
Then, I updated my code for the inputs and rotations.
Afterwards, I did a simple test to make sure the objects move. And they did move, but it's not the way I want them to move. I need them to rotate based on the view of the user. Right now, I think they are rotating simply based on their own location in the world. So it's not technically a bug, just needs an update change.
And that's my progress for September. I will be doing a bit more develpment after posting this for October's progress update. It feels good seeing things click and come together little by little!