Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

Map and Terrain

Map and Terrain

3,337 0

I'm going to start building a map. Just something super simple and basic with some underpasses that enemies can spawn in without just popping up on screen and some objects to “kite” enemies around. so far I haven't been using any textures so creating a map thats just all white will be confusing so I've found some free textures on the unity asset store by A dog's life software(https://assetstore.unity.com/packages/2d/textures-materials/brick/18-high-resolution-wall-textures-12567#description).​ Once those are imported it will be looking a little better and I'll start constructing the world with cube objects.

So, I've just put in a platform and a ramp and run it to test it out. The player is able to move up the rump onto the platform but gravity seems to not work properly so they will just fly off into space. this will also happen if they continue to collide with the wall. I dont rteally know whats going on here so i will need to do a little research on this.

Basic map with platform and ramp

Haha, feeling kinda stupid. at some point i must have accidentally turned off gravity on the player's Rigidbody so that has fixed that issue.

Now i have a super simple map I'm going to implement spawning in the underpass of the ramp. Using the same delay code from the attack code i have created a SpawnManager script which just creates an instance at the given location. Using some unity documentation on Instantiation i figured out how to create an instance at a given position (Technologies, n.d.). Then with a forum post i figured out how to create an array of Vector3 to store all the possible spawn points which, for the moment, is only one possible spawn. then it would randomize one of those points to span the enemy (Initializing an Array of Vector3 in c Sharp # - Unity Answers, n.d.).

I also rebaked the NavMesh for the enemies to travers this new map. I might look into changing the Agent settings so that they will drop down from higher areas to track the player.



Technologies, U. (n.d.). Unity - Manual: Instantiating Prefabs at run time. Docs.unity3d.com. https://docs.unity3d.com/Manual/InstantiatingPrefabs.html​

Initializing an array of Vector3 in c sharp # - Unity Answers. (n.d.). Answers.unity.com. Retrieved April 14, 2022, from https://answers.unity.com/questions/321996/initializing-an-array-of-vector3-in-c-sharp-.html

‌

‌

Discussion

Loading comments...