Description

When a map is added as a local variable for a blueprint function, the blueprint will failt o compile.

Regression:
No, same behavior occurs in 4.16.3

Workaround:
Setting the key/value pair to int/int will allow the blueprint to compile. This in turn allows other key/value pairs to compile as well

Steps to Reproduce
  1. Open UE4 Editor (any project)
  2. Add new Blueprint based on actor
  3. Add new function to blueprint
  4. Add new local variable to function
  5. Set local variable to float
  6. Change variable type to map (will default to float/int as key/value pair)
  7. Add element to map variable
  8. Compile blueprint

Result:
The Blueprint will fail to compile with the errors shown in callstack field

Expected:
Blueprint compiles after adding local map variable / element

Callstack

errors reported in blueprint on compile:

Blueprint Internal Compiler Error: Could not connect default value to input pin [Local Var Name]
Default value " for [Local Var Name] is invalid: 'Map inputs (like 'Local Var Name]') must have an input wired into them (try connecting a MakMap node).'

Have Comments or More Details?

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

5
Login to Vote

Won't Fix
ComponentUE - Gameplay - Blueprint
Affects Versions4.16.34.17.24.184.23
CreatedOct 11, 2017
ResolvedAug 18, 2021
UpdatedAug 18, 2021
View Jira Issue