Day13, Enemy Evade
Today’s Implementation was rather pretty simple compared to the other two that I am still somewhat struggling with. It is perhaps because I only have to worry about making a change in one script and that is, the Enemy.cs.
First I made a variable with a value of gameobject with a tag == lazer. Then using a Vector3, found a distance between the gameobject and the current object, Enemy. And when using the if function with the variable, if distance between the laser and the enemy is less than 3, the enemy movetowards* but with a -1 value. So if the laser is a little to the side, the enemy moves opposite of the direction in value of -1 of the laser. If the laser comes in front of the enemy, enemy jumps back -1 value of the laser and etc. First, I had the enemy move too fast away from the laser that Even as I was spamming the space bar, I just couldn’t get them any hits. Then eventually the speed of their evasion was reduced to 5 * deltatime to balance.
Aside from the current project, I also started looking in the Unity asset store. It seems as if some assets are made to be more compatible in a certain setting. Such that Wildlands bundle works in Universal Render Pipeline, but not in regular 2D or 3D setting. It has a problem of materials not coming compatible and turning the entire animation or prefabs with fill of pink. It was an interesting find that even within unity, there are things that are more compatible with a certain setting and some not work at all at times.
I also learned to use Real world height map in unity to create a terrain and which if I chose to make an open world game with the real world height map, I can recreate with accuracy.
I understand that I am a little distracted from the current course of work. But I am learning more in the direction of my interest in the world of coding. When I have the time, aside from the “work schedule”, I will also update the blog in regards more side of other development as well.