I have a setup where I spawn in actors as pickups for the player, they use collision sphere with physics to drop into the world and collide with the world. When I do a build using Nativization, this physics sphere seems to lose it’s collision settings and falls through the world.This only happen when spawning a child of the base blueprint I created. Spawning the base blueprint seems to work just fine. I found this bug report that may or may not be related to the same problem I’m having, so here’s the link for that just in case there’s overlap there.
… Repro
Using an example project like the Blueprint 3rd Person Example…
Create new blueprint Actor.
Inside this new actor, add a collision sphere and enable physics and I also constrain rotation on all axis and set it to only collide with WorldStatic channel, ignore all other channels.
Now make a child blueprint of this new Actor blueprint. No changes inside the child, keep as is.
Inside the level blueprint on begin play, spawn in the child blueprint.
Finally build the project using Nativization for play test.
When you play test notice the sphere drops through the floor, in stead of colliding with it.
I was able to reproduce this issue on our end. I have written up a report and I have submitted it to the developers for further consideration. I have provided a link to the public tracker. Please feel free to use the link provided for future updates.
I just wanted to add some info here that I just discovered based on another blueprint I use in my project. so with this one, it’s basically for damage, when the enemy does damage to the player, I use a collision sphere to run an overlap event. In this case, it doesn’t lose collision all together, but it changes the channels it can collide with. Basically my enemies end up hitting both themselves and the player. I have some custom channels for both player and enemies for collision, for these occasions so only specific things can overlap of course. So I’m not sure exactly what’s going on there, how the engine assigns these channels, based on what, but it changes from my “Custom” settings to something else.
The reason I mention this is because originally it looked like it loses all collision, but it seems rather to change which channels are affected. I’m sure you guys would see what’s going on there when you look at it, but I just wanted to add this just in case it makes a difference in finding the problem there.
I’m having the same issue and searched for the problem on my side for the whole day. It is really frustrating how painful it is to enable nativization because of all the problems you encounter. And I am having only a relatively small project.
I can’t be 100% sure but I may be having the same issue with some of my collision presets. In editor or stand alone the collision works as I expect and nothing I am using has custom collision. Once I nativize my build a child actor of mine seems to ignore its collision presets and instead use the default collision of its object type.
I encountered the same issue when nativizing our project in 4.16.1. I investigated a bit and it seems that collision presets are not set correctly for nativized blueprint components. If I ask GetCollisionProfileName for the affected component, it reports correct name, but GetCollisionResponseToChannel can return wrong results. Calling SetCollisionProfileName first with some dummy name and then again with the intended name will apply correct collision profile and the components will start to colliding and overlapping as they should.
I wrapped this to a function to make a playable proof of concept nativized build for benchmarking, but it is in no way sustainable to add that everywhere where custom collision profiles are used. I attached picture of the fixup function.
Rudy, is there some developer comment available as to why this is not being fixed? It has been retargeted several times now, and currently has no target release at all.
I used the method discovered by @jh_hmq for a while, which fixed some things, but then I encountered a very stubborn issue where a couple actors refused to overlap in packaged+nativized Blueprint, even though their collision channels were reporting correctly (via “Get collision response to channel” → “Print text” on runtime). Somehow, re-applying every collision channel solved this problem (“Get collision response” → “Set collision response”). Only god knows why this works.
tl;dr: I now have this function attached to every collide-able actor’s BeginPlay event, which takes an array of “Primitive component object references” and applies this nonsense workaround to each.
I’ll append a new note because the issue is still happening in 4.23.1 and it seems to be getting worse. The way I’ve been solving inexplicable nativization-collision bugs lately is by spawning collision components at Event Begin Play rather than setting them up prior to runtime. I wish Epic would just fix this.