Jump to content
  • Advertisement
ethancodes

C# quick implementation of different colliders on corner tiles

Recommended Posts

I'm fairly new to creating full 2d levels, so please feel free to correct me if I use incorrect terminology or if I'm doing something wrong here. Currently, I am using the Tile Palette with several sprites placed on it to create my levels. With that I can just run my mouse across the screen and quickly place tiles. Then on the TIlemap gameobject I place a Tilemap Collider and a Composite Collider. This works great, it's quick, simple, and efficient. However, for the next part of my character controller I'm looking at adding the ability to do a ledge grab. After doing some research, it seems like a common way to do that is to make the ledge he can grab "grabable" by putting a different collider on them. So my question is, is there an efficient way to where I can let the Tile Palette know if I use a specific corner sprite, place the ledge grab collider on it? Is there any way other than going through all the ledges in the game and manually placing them there? I'm also open to any tips on level building and using the Tilemap, etc that may help me out as, like I said, I'm pretty new to it all. Thanks!

Share this post


Link to post
Share on other sites
Advertisement

After doing some more research, I've learned a bit about scriptable tiles, but I'm still a little confused about how exactly this works. If I have a tile palette with top, corner, side, and bottom tiles, could I make just the corner tiles scriptable tiles and then using that script make them have an individual collider of a different layer or tag?

Share this post


Link to post
Share on other sites

We're missing some important context, here... it sounds like you are using Unity? You should try some Unity-specific forums (either the Middleware subforum here, or another forum).

That said, from what I know of Unity, it sounds like you need to add the "edge grab" colliders to the components of your "specific corner tile" prototype. When that tile is instantiated, it will come along with all its components.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!