Hello!
I just started learning Unity and C Sharp. In my first game i created a map with a tile map, but i didnt know how to add a ridgidbody 2d to the floor for example. I solved the problem with a 2D game object in the layer -1 so it isnt visable. Is there a other way to solve it, so i dont have to add a extra 2d object?
I wish yall a nice day 😄
#How to add components like ridgid body 2d to a tile map?
1 messages · Page 1 of 1 (latest)
If you mean the Component "TileMap" then no you can't add a component to another component. If you have a GameObject named "TileMap" then you should be able to add a rigidbody the same way you add any other component:: Add Component --> Rigidbody2D
Yes that’s how I use it. But my question was, is it possible to make hitboxes for the floor, without a extra game object
there is tilemap collider in unity you can use
Thanks I will look for it
If it’s a flat floor then a box collider would suffice. Then as anupam says you’ve got the tilemap collider. Another option is the mesh collider which you can modify more to fit your object, iirc.
you need to do a bit of modification on tilemap colliders
or else your player will bounce and gget stuck on corners
thanks!
oh okay thanks for the information!