Description

Using a For Loop inside of a Blueprint Function or Function Library will always return index 0 when used in the Construction Script.

This was reported and tested in 4.19.2 (CL-4033788). This was reproduced in 4.20.2 (CL-4302132) and Main 4.21 (CL-4362844(

Steps to Reproduce
  1. Open the UE4 Editor and create a blank project
  2. Create an Actor Blueprint and make a For Loop with a Print String in the Construction Script (See Screenshot)
  3. Add it to the Viewport and notice that the values 0 - 10 print out
  4. Add a new Function and setup the For Loop within (See Screenshot)
  5. Replace the For Loop in the Construction Script with the Function
  6. Notice the changes in the Viewport

Results: Print shows: 0, 0, 0,0, 0, 0, 0, 0, 0, 0

Expected: Print shows: 10, 9, 8, 7 ,6 ,5 ,4 , 3, 2, 1, 0 and so on.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-64166 in the post.

0
Login to Vote

By Design
ComponentUE - Gameplay
Affects Versions4.19.24.20.24.21
CreatedSep 18, 2018
ResolvedSep 18, 2018
UpdatedSep 19, 2018
View Jira Issue