Block buildings and pathing issues – Week 12
- Christopher Cromb
- Dec 28, 2020
- 2 min read
Updated: Nov 25, 2021
I have been trying out different ways of making the buildings, specifically by using basic wooden blocks a child would use to build the buildings, with somewhat nice looking results. The addition of a randomly generated colour for each block makes for a fun and diverse set of buildings. Below is before pressing play (left) and after pressing play (right).
While it does look good, I have however decided against this type of building and decided to stick with the originals. My reasoning for this is that the original houses use about 8 separate blocks, but these new buildings have over 80 separate blocks in each, creating large amounts of lag when they spawn from randomising so many colours and continue to cause issues navigating the scene from the pure amount of objects. I will however be reusing the randomising colours for the original buildings to add some more variety. This test building was valuable to learn the limits of what I’m generating and has caused me to reconsider ways I can improve my town while not stretching resources too much. Below is a gif showing a full rotation of the building.
I have also started work on mapping the path that the toys will follow along the pavements. My current plan is to create a prefab that has a collider and raycasts when awake. They will be placed on the road prefab pavement corners pointing left and fire the first awake in the scene, adding the hit collider to a list and causing that collider to fire at the next one, stopping once a full chain has been made around the town. The main result I need is an ordered list of targets. I can then create a system that sets the toys to go to the next target in the chain, then the next, allowing them to loop around the town.
However, I have already encountered several issues with this. I did a trial run with 4 of these raycasting prefabs pointing at each other in a square and it succeeded, however it doesn’t seem to be working with them when they fire around the town. It seems to collide with the rest of the town, even when there appears to be no colliders in the way. I then set us a layer for the raycasting, which showed a new issue as the raycasts from my raycasting prefabs didn’t seem to be hitting their targets and just past through them. I used a debug raycast to check visually and it showed that they seemed to not detect each other. I will have to continue researching this if I want to make the toys able to walk intelligently around the town. Below is a successful test chain with the debug raycast.
Comentários