I have a static mesh that is assigned at runtime, but it doesn’t have collision even though I set it up for collision in the component. What am I missing? Here is the constructor:
Seems I should be able to set up collision for the component and assign the mesh later, but it doesn’t work. I also tried calling an UpdateCollision() function after the static mesh gets set, but that didn’t work either. I should also mention that I was using the “Enemy” collision profile before I switched to changing out meshes at runtime and it worked just fine, so I don’t think the collision profile is the problem.
Found the problem. I had to give the class a default static mesh in the constructor. I found updating the collision after changing the mesh is also necessary.
If I didn’t give the object a static mesh from the beginning, then I could never assign a new static mesh along with new collision to it later. For the collision to work on the new mesh, I had to give the object a default mesh to start with.