Difference between in-editor and compiled collision

I have a project with a procedurally generated track mesh that gets constructed when my game starts. The collision on all objects is set to “Block all” and each track component gets set “collision” to “true” during generation.

This works nicely in the editor. The track appears and I can drive around on it.

When I compile and package the project, it looks the same: the track gets created as before and appears exactly as in the editor. Except for one thing: collision is disabled. Neither the player nor any test objects I created collide with my generated track.

Any idea what I can do to enable collision for the compiled game? Why is there a difference between in-editor play and compiled play, and what is it?

Hello shezi,

This sounds like it could be an issue with the collision setup itself. If you are using a spline for your generated track, there was an issue with spline collision not working properly when it is set at runtime. If you are still experiencing this issue, please update to a later version of the engine, such as 4.12.3, and let us know if it still occurs. If so, we will be glad to investigate and help you resolve your issue.

Have a great day

The problem persists in 4.12.5, so something is still missing. Can I upload the project somewhere and you’ll have a look at it or something?

Sure, you can upload it to Dropbox and PM me a link on the forums: https://forums.unrealengine.com/member.php?160394-Sean-Flint

After investigating the issue further, I was unable to reproduce it in a clean project, which leads me to believe that it is something specifically related to the setup, which is slightly complex.

If you are able to narrow down the root cause of the issue, and you believe that it is a bug on our end, feel free to re-open this thread and I’ll be glad to continue to investigate.

I noticed warnings in your log related to attempting to access an array index that is out of bounds, so it may be worth looking into resolving that issue to see if that has something to do with your collision not working in the packaged game. It is also possible that you are attempting to access something before it is initialized, as operations don’t always run in the same order in a packaged game as they do in the editor, so keep this in mind when debugging as well.