Unity collider type sprite vs grid4/22/2024 ![]() ![]() Use the Unity Profiler throughout your project development along with the free profiling tools available for Xcode.ĭon’t use more than ⅓ of the available RAM on your lowest-end target device. Profile on your worst available target device. If these elements are non-performant, there is little you can do later on to optimize your code. Think about the performance of your assets (the data) from the beginning. Again, a combination of both is probably useful to consider: use TilemapCollider2D for static, immovable terrain, and use GameObjects for dynamic terrain objects.Before we look at how Tilemaps improve performance, here are a few general tips to remember. To be fair here, the performance cost of a moderate collection of objects is pretty low on modern hardware, so you shouldn't see a real problem unless you're really going overboard somewhere. there are exploding barrels in certain areas of the map or players can damage houses), recalculating the TilemapCollider2D will possibly be even more expensive than keeping them as GameObjects. However, if the terrain changes regularly (e.g. I think you'd find that a lot of modern games use a combination of both approaches.Īs far as pros and cons, the GameObjects are more expensive performance-wise than the precalculated TilemapCollider2D, especially if you can set it to be a composite collider. This is especially true if the player is able to move the objects around or destroy them in a non-scripted fashion. If you need specific information on what you've hit, this approach is potentially still a bit lacking, however.Ī more complex game may be better served by making some or all of the terrain objects standard GameObjects. You can create custom tiles that make these objects automatically when they are placed with a bit of code, which can simplify your workflow quite a bit. You may use some empty GameObjects with trigger colliders for damage effects and doors and the like. You actually wouldn't directly target a specific type of terrain in scripts in these cases, since the colliders are simply there to keep the player from walking through walls. ![]() Much like using pixel art, the restrictions are part of the style. Top-down 2D Legend of Zelda and Pokémon style games use very simple geometries that lend themselves well to the first style. It depends a bit on what you're trying to do. But it won't strictly follow the 'tile' style ( although I know I c Having the object as game-object seems to make thing easier in concern of using them for specific thing ( script or other thing). Having the tilemap handling exotic-shaped object is nice ( + the tilemap colider ) and it feels good to 'follow' the grid/tile rules - but having to restrict object to tilemaps seems constraining- especially when drawing more weirdly-shaped object ( like, weird, long rocks, or light-pole ).Īlso won't having them all merged in a single layer (the tilemap) make targeting them in script harder ? I have no experience so I'm trying to learn as much as I can on the basics. I know there's not an universally 'better' approach and I should focus on whatever work better. What do you think are the pros and cons of each ? They are not then placed ( I think ) by a palette editor but manually, like any game object. Tilemap collider 2d ( that to my suprise, created the collider around the drawing shape, curve and all, instead of a square.) and Composite collider 2d.Īnother tileset I've seen though, used prefab for props - with their collider already in place and all in the tileset used by this tutorial, big props ( such as house, rocks or anything that is not squary ) is made up or multiple tiles. I had a question though, or moreso, asking for good practices ! I'm learning unity tilemaps and objects ( and have already posted many question here, which allowed me to learn so much, thank you all) by following a (very) good tutorial for a zelda-like. r/GameAudio - It may look good, but does it sound good? r/LevelDesign - Learn to make excellent levels and worlds. r/GameDev - Meet and communicate with other game developers. r/PixelArt - Admire, share, and observe beautiful pixel art. unit圓D on 8chan - Unity-focused image board Unity 2D forums Tutorials Filter Wiki List
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |