Blueprint: Actor Enable/Disable Collision/Simulate Physics bug?

Hey,

I have an issue with Set Actor Enable Collision and Set Simulate Physics methods when i am trying to toggle between them.

Also i am unable to teleport/change location for an entity once Set Simulate Physics is set to true.

I am unable to disable Collision and Physics simulaton on an actor after these methods are set.

This is my Actor Setup:

  • Scene Root Component
  • Static Mesh Component

Hi Azarus,

Can you show us a screenshot of rest of your Blueprint graph? I’d like to see your toggle setup, as well as what your doing to teleport after Simulate Physics is on. Thanks!

This is where i update position/rotation/scale for my mesh.
Selected Prop variable comes from a ray tracing.

This is where i unset physics simulation and collision.

This is where i enable/re-enable physics simulation.

This is where i spawn actor:

Fun thing is that if a physics simulated disabled after spawn everything is fine. But after physics simulation is enabled i am unable to change transform of mesh no matter what i do.

If you wish i can make a test project because this blueprint is a complex one.

If you can reproduce this in a test project and upload it somewhere for me, that would be very helpful. I’ll continue looking into this in meantime. Thanks!

Hey ,
Thanks for your time.
Here is example project:
http://neocoregaming.com/project.

I created it from scratch using a blank template. And it has same issues.

Left Click to Drag & Drop an object. (Physics should be enabled after it’s released / disabled when its dragged. problem is that you can’t move object.

Right Click to Spawn an object and Freeze it. (Everything works fine as expected.)

And Thank you again! :slight_smile:

Hi Azarus,

Your setup looks correct to me with one exception: you’re setting Physics on Cube component, but moving Actor. So when physics are simulated on Cube, it separates from location of Actor root (a scene component), and Actor ceases to be movable with Set Actor Transform. I’m going to look further into this to see if there’s a bug involved in that, but it’s not ideal way to set this up regardless.

Instead, you can do one of two things:

  1. Make StaticMesh component root of Actor being moved.
  2. Get Cube component from DraggedProp variable and Set World Transform for that on Tick

Give that a shot and let me know if that solution works for you.

As a side note, this was fun to play around with. Without knowing what you’re looking to do with this functionality, you may also want to look into physics handles or, conversely, restricting physics to planes when turning physics on to drop it (right now you can throw object, if you want). Also: you might want to throw a check in there to disable right-click functionality when DraggedProp variable is valid, because right now it leaves Actor hanging in air.

Hope that helps!

2 Likes

Thank you, it worked. I am trying to setup a simple sandbox builder mini game where you can select props from a menu and spawn them. And thanks for ideas! I’ll definitely look at them :slight_smile:

Yes, thank you so much, this really helped. This is still case as of 4.11 for anyone reading. Setting StaticMeshComponent makes things work as expected, problem lies with moving actor vs moving mesh component.

This thread helped me with a similar problem attaching a physics object to a motion controller when “picked up”. mesh was parented to a scene component so I could use offset for a custom grip position, but thing would just freeze and break.

I thought it mighta had something to do with a separation between scene component and mesh, but this put it into clear language and helped me get on with my life.

Thanks all!

Made it work for me! Thank!