Set Actor Enable Collision in the construction script not working properly

If you use the “Set Actor Enable Collision” node in the construction script of a blueprint class (leave New Actor Enable collision unchecked for no collision), go to play, stop, and then delete the node - The engine still thinks that for some reason there should be no collision on the object.

Only way to fix it I’ve found is to delete the object from the world, and then place a new one.

Repro:

  1. I’m using the First Person template. Make an actor blueprint class. Add a cube static mesh component to it. Place the object in the game world. Go to the construction script, and connect this node:

81145-collisionbug.jpg

  1. Hit play - notice that the object has no collision - as it should be.
  2. Go back to the construction script, and delete the “Set Actor Enable Collision” node.
  3. Recompile, save.
  4. Hit play - notice that the object still has no collision - even though we got rid of the node.

Hi DigiMish,

The construction script is only run when the actor is destroyed and recreated, typically during movement. It is primarily used during level editing. Move the asset after compiling the blueprint and see if the error is addressed, if not, delete the copy of the asset and create a new one and it should be working the way you expect. If you are wanting to control collision during PIE, I would recommend utilizing the Event Begin Play or other events that are intended for PIE.

Hi DigiMish,

We have not heard from you in several days. I am marking this as answered for tracking purposes. If you are still experiencing this error, please comment with the requested information.

Try checking the “New Actor Enable Collision” checkbox

05/11/2021

this is still a problem and only solution seems to be delete and replace OR have “event being play - enable collision”.

once construction script disables collision its ■■■■■■.

2 Likes

This is still an issue after all these years with Unreal 4.27.2 how has this never been fixed?

1 Like

For anyone still wondering - this is an expected behaviour.

Construction script will change any default properties for any actor instance and saving the World (i.e. your level) would save those changes in the World. As someone mentioned it is executed on instance creation, means when open your BP, or place your Actor in the world, or when it is loaded with the world etc. If you just clear construction script it would do nothing, because already applied and saved changes not going anywhere. If you need to revert what you did, make explicit opposite changes in construction script.
Although I would not recommend doing it that way. The more proper way would be to create Bluetility with all necessary operations and run it over the necessary objects of the world.