# Paper2D-Tilemap Component Generated at Runtime not Generating Collision

**URL:** <https://forums.unrealengine.com/t/paper2d-tilemap-component-generated-at-runtime-not-generating-collision/359457>\
**Category:** World Creation\
**Tags:** tile-maps, unreal-engine, Collision, dynamic, Components, question\
**Created:** [June 3, 2016, 2:59am UTC](https://forums.unrealengine.com/t/paper2d-tilemap-component-generated-at-runtime-not-generating-collision/359457 "2016-06-03T02:59:13Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [July 26, 2016, 4:46pm UTC](https://forums.unrealengine.com/t/paper2d-tilemap-component-generated-at-runtime-not-generating-collision/359457/21 "2016-07-26T16:46:18Z")

</div>

Hm, I’ll link to the files that were changed directly, and these are links to these files in the Master Branch.

PaperTileMapComponent.cpp has been edited at line 712, 731, and 743

[PaperTileMap.h][2] has been edited at line 210.

[PaperTileMap.cpp][3] has been edited at line 533.

I would just post direct pictures and pastebins, but we must keep that contained to Github for EULA reasons.

[3]:

---

<div class="post-metadata">

**Author:** ![Brandelan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brandelan](https://forums.unrealengine.com/u/Brandelan)\
**Post date:** [July 27, 2016, 12:44am UTC](https://forums.unrealengine.com/t/paper2d-tilemap-component-generated-at-runtime-not-generating-collision/359457/22 "2016-07-27T00:44:02Z")

</div>

I downloaded the master branch and I couldn’t ever seem to get the proper tilemapcomponent. So I updated the three files you posted.

When I run the game now, I just get a bitarray less than error. I’m not sure at all what this error is and the program crashes out before I can get a screen grab or write it down. I’ll try again in a bit and see if I can screen cap the error.

---

<div class="post-metadata">

**Author:** ![Brandelan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brandelan](https://forums.unrealengine.com/u/Brandelan)\
**Post date:** [July 27, 2016, 1:25am UTC](https://forums.unrealengine.com/t/paper2d-tilemap-component-generated-at-runtime-not-generating-collision/359457/23 "2016-07-27T01:25:56Z")

</div>

Here’s my error window that pops up now when I’m running the game with this updated code.

![100247-spritetilemaperror.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/a/6/2a6568d8501491e79be20fb26adcd4883797f1a5.png)

---

<div class="post-metadata">

**Author:** ![Brandelan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brandelan](https://forums.unrealengine.com/u/Brandelan)\
**Post date:** [July 27, 2016, 1:42am UTC](https://forums.unrealengine.com/t/paper2d-tilemap-component-generated-at-runtime-not-generating-collision/359457/24 "2016-07-27T01:42:23Z")

</div>

Well, for the record, i just got it to work once…

That particular error above might be unrelated and just from upgrading from 4.11 to 4.12

I seem to remember getting it on a similar project when upgrading.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [July 29, 2016, 8:30pm UTC](https://forums.unrealengine.com/t/paper2d-tilemap-component-generated-at-runtime-not-generating-collision/359457/25 "2016-07-29T20:30:17Z")

</div>

Are you still having crash issues with your project? also, when you say that you “just got it to work once.”, do you mean in relation to opening the project or the expected behavior after getting the fix?

---

<div class="post-metadata">

**Author:** ![Brandelan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brandelan](https://forums.unrealengine.com/u/Brandelan)\
**Post date:** [July 29, 2016, 8:49pm UTC](https://forums.unrealengine.com/t/paper2d-tilemap-component-generated-at-runtime-not-generating-collision/359457/26 "2016-07-29T20:49:48Z")

</div>

I’m still having crashing issues, but I really think it’s unrelated to the paper 2d tile map update.

Basically, when I wasn’t sure the tile map issue would ever be fixed I moved on and removed it from my project. I then updated that project without the tile map component to 4.12. I had crashes after the update related to the update. I fixe those crashes.

When you posted this fix, I went back to the old 4.11 project with the tile map component. I had to update that project to 4.12. And as a result I got the crashes I originally had that were unrelated to the tile map. I’m not 100% sure how I fixed them anymore. So I’m still having those crashes. One time, though, the project happened to load without crashing, and the collision mesh got generated properly with the new tile map code.

I’ll create a new project in a bit to double check that collision tile map does indeed work.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [July 29, 2016, 9:16pm UTC](https://forums.unrealengine.com/t/paper2d-tilemap-component-generated-at-runtime-not-generating-collision/359457/27 "2016-07-29T21:16:44Z")

</div>

Thank you for working with me on this. As mentioned, I don’t have any experience using this component so this helps a lot. Whenever you get around to testing it, please let me know the results.

---

<div class="post-metadata">

**Author:** ![Brandelan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brandelan](https://forums.unrealengine.com/u/Brandelan)\
**Post date:** [July 30, 2016, 7:13am UTC](https://forums.unrealengine.com/t/paper2d-tilemap-component-generated-at-runtime-not-generating-collision/359457/28 "2016-07-30T07:13:51Z")

</div>

Yup. I started a new project and built a tilemap on the fly in code, and it works as expected. 🙂

 ![100761-collisionworking.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/7/6/4766c39f60863a711a6fc64bcc3fb1b815fd9465.png)

Also, to give a little acknowledgement, the sprite in this example is from [[http://opengameart.org/content/platformer-art-deluxe](http://opengameart.org/content/platformer-art-deluxe)][2]

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [August 1, 2016, 1:44pm UTC](https://forums.unrealengine.com/t/paper2d-tilemap-component-generated-at-runtime-not-generating-collision/359457/29 "2016-08-01T13:44:44Z")

</div>

Thank you for the help. Hopefully these changes will be available in the 4.13 previews but should definitely be available in the full 4.13 release. I’ve verified the bug report so we’re all done.

Have a good day!

---

<div class="post-metadata">

**Author:** ![SLK\_Leon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SLK\_Leon](https://forums.unrealengine.com/u/SLK_Leon)\
**Post date:** [February 13, 2023, 4:28pm UTC](https://forums.unrealengine.com/t/paper2d-tilemap-component-generated-at-runtime-not-generating-collision/359457/30 "2023-02-13T16:28:33Z")

</div>

I also ran into the problem of generating collisions for the TileMap component, now the RebuildCollision() procedure works. I have a test TileSet that has multiple tiles without collision and the function takes that into account! At first I thought that I would have to manually create collisions for each tile  
Thank you for your work! I’m happy

 ![tilemapecolision](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/9/2/492b76730c236d3d7098f02fb893d4f068bc55d8.png)

[Previous page](https://forums.unrealengine.com/t/paper2d-tilemap-component-generated-at-runtime-not-generating-collision/359457.md?page=1)
