Construction script not working

Hello,

Here is a screenshot of the construction script.

This construction script basically counts the total number of blue and pink pickups in a level and sets them in the ‘Total Blue pickups’ and ‘Total Pink pickups’ variables respectively based on an editable enumeration. I created this while following a Digital Tutors tutorial about blueprints and wanted to try my own technique of calculating the number of pickups.

However, the construction script is not executing while I am making changes in the viewport. Also, in the event graph, I used a ‘Event Begin Play’ node to print the values of the ‘Total Blue pickups’ and ‘Total Pink pickups’ and when I run the game, the counts are always 0.

But again, when I cut and paste the entire script from the construction script and into the Event Graph, everything works just fine.

There are a few questions :

  1. Am i doing anything wrong? If so, how can I fix it?
  2. Are any of the nodes that i have used in the image not meant to be used in the Construction Script?
  3. Is this a bug? (I have read a few other posts about this sort of Construction script error in the earlier versions of UE4 and there, this behavior is classified as a bug.)

Thank you

Just ran into this using the same tutorial. Looking for a solution too.

Found the answer here.

I also had to delete the “Get All Actors of Class”, delete the LENGTH node, do it correctly then it worked correctly in stand alone mode.

THANK YOU. I’m also following the same digital tutors tutorial and became baffled as it worked for the tutor but not for me. This solved my problem. I wonder what changed between versions. Well, thanks again.