1/15/2024 0 Comments Cliffs in 2d gamesThe colliders are tagged appropriately based on what function they should perform. To achieve this quickly I have attached a static RigidBody2D and a Collider2D (set to Trigger) to the tiles that make up the scene. When pressing left or right on the stairs the player needs to actually move up the stairs and not just into them in order for the control scheme to feel natural. In the example the player can go up the stairs and fall off the cliffs if they approach them. There are many ways you could approach a problem like this, however a quick and easy way is to check what surface the player is walking on and then calculate how the player should move based on the surface. Making the terrain your character is walking on have an impact on the controls can add extra depth to your control scheme.įor a top down 2D game there is not any gravity and your player is not using collision detection to walk on surfaces so doing things like walking up a set of stairs or falling off of a platform can require a little extra thought.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |