Evan's Dev Blog

Capstone Chronicles


Where Does This Go?

After my last post about walls, I’ve since spent much of my development time working on where the walls where go. At the moment I’ve put together a rudimentary script that basically creates 4 objects, for 4 walls of a room, that call the generation script with their sizes. I think this will change though as I incorporate more scriptable objects, which, in Unity, are data containers that can save memory over creating a bunch of copies. I’ve used scriptable objects before but it’s been some time so I’ll have a little refresher. For the time I was just focusing on positioning though, how to get the walls to line up with each other and not have any gaps.

The mistake I made was assigning positions in 2 spots. Basically my thinking was that I would create these empty game objects and initialize them with their end positions and then the generation script would just start from there. The problem was in my generation script I included start points already so I think what happened is the generation script would offset from the objects current position thus moving the object to the wrong position. To solve this I just need to change it so the position is only moved in one location, I’m still improving it as I’m scaling up the amount of rooms and their relative position to each other.


css.php