How do I enable collision and physics on Mesh components?

Hi! I have created a contruction script Blueprint which use to create in editor randomless debrish-like sectors. It’s very similar to random folliage blueprint from Blueprints Office demo but with some little diference.

What I’m facing and I cannot solve is:

  • How to enable collision in created meshes?
  • How to setup them as movable?
  • How to enable physics on them?
  • It is necesary to deattach them from blueprint? If it does, how to?

Thanks!!!

so you want to not be able to pass thru them or you want to kick them around?

Also make sure meshes have a collision on themselves in mesh editor.

I want to can do both as possible. To kick them around if they should, and to make them unpassable if they are static.

Yes, I already checked and setted collision in mesh editor

What behavior are you seeing now? Any way we can see a screenshot of how your BP is set up?

Meshes get collision in mesh editor.
Double-click mesh, and then select one of collision modes (I usually use 6 DOF or automatic convex.)
Then save and close again.

For physics, that doesn’t come from mesh, it comes from actor. Once you’ve dragged it into world, you should be able to click “movable” right next to position/orientation widget, and then scroll down and click to enable physics for instance.

If you want to bundle mesh up such that it does this each time, you can create a blueprint that has those things taken care of each time you drag it into level.

Edit: As this is runtime, you need to get ahold of actor that can run physics, not just mesh. Or in other words, you need to spawn an actor. Easiest might be to spawn copies of a blueprint that already sets up right properties?
Check out FPS Starter Blueprint level, as it spawns yellow balls with physics.
It spawns a blueprint that contains a ProjectileMover and a Collision and a Mesh; you should be able to do same with different component set-ups. But a mesh alone is not enough.

Yes, I cannot set (or seems like not) set moveable from blueprint when spawning in my construction blueprint. And set collision enabled is being ignored…

From what I understood he was spawning them in I guess depending on how he was doing this he would not see moveable.

Hey ,

BP_Random_Foliage Blueprint from Blueprint Examples project uses Foliage system to place Static Meshes. If you’re using that as your basis, your placed Meshes will be restricted to limits of Foliage system. Your meshes will not be movable from where they are originally placed and won’t respond to physics.

You can, however, adjust collision. Open mesh in Static Mesh Editor, and expand Static Mesh Settings. Change Foliage Default Settings from None to InstancedFoliageSettings, and a whole bunch of new options will appear below it (you may need to expand section). Included among these new options are Collision Presets.

You can look into it a little more here:

If you’re looking to place movable physics actors, you’ll need to use a different system. You can absolutely build this in Blueprints and follow some of advice on this thread for getting that to work way you would like.

Hope that helps!

Sure, I will upload screenshots today later, but basically, I’m copying folliage random generator: I create a meshcomponent in a construction blueprint, then I instance a Mesh on it on a certain point. And I cannot set that new (or news) intanced meshes as I need (with blocking enabled and movable)

Well, I tried approach that here in forums and answershub is commonly used of generate meshes as instanced mesh components in construction blueprint.

But this still doesnt work. I just readed that construction blueprint-created elements are baked into scene, so that discards any chance of have this meshes moving like rigidbodies.

So, I tried to , at least, have these elements with blocking collision working. They “work”, but if I move any transform property at instanciation moment, collider just doesnt adjust to new mesh transform and remains with original scale/rotation/pos from beggining. There is no way to solve this?

Just to clarify, I want to make a Construction Blueprint that randomly put Debrish-like meshes into editor (random location, scale and rotation), and that meshes should have collision (at least, if they cannot have physics too).

I apologize, I misread that Blueprint somehow… it does not use Foliage system at all, so you can safely ignore everything I just said =)

It looks like there’s a conversation happening in another Answer, which you can find here:

I would encourage you to look through that and linked forum post, and see whether you can work with them to figure out a solution.