Summary
UEFN throws cooking error when you update an edit session after instantiating material from within npc_behavior_class EVERY SINGLE TIME. Managed to get 100% repro rate.
Both UEFN and Fortnite files verified, PC restarted, happens on old projects and newly created ones.
TLDR:
Add “DynamicMaterial : M_DynamicMaterialTest_material = M_DynamicMaterialTest_material{}” tp your favoruite class derived from npc_behavior_class and get a cooking error
Please select what you are reporting on:
Unreal Editor for Fortnite
What Type of Bug are you experiencing?
Verse
Steps to Reproduce
- Create a new blank creative island project.
- Add new Verse fike deriving from npc_behavior_class and name it “new_npc_behavior”.
- Create a new material with at least one parameter (probably beaks with no parameters too) named “M_TestDynamicMaterial”
- inside created “new_npc_behavior” under “new_npc_behavior := class(npc_behavior):” add “DynamicMaterial : M_TestDynamicMaterial_material = M_TestDynamicMaterial_material{}”
- Create new NPC Character definition and make it use verse script. Also set NPCBehaviorScript to “new_npc_behavior”
- Add NPC_spawner_device to a map and set its NPC character definition to the newly created one.
- Push changes and enjoy cooking errors preventing you from correctly launching a session every single time
Expected Result
Instantiating meterial from withing npc_behavior derived class does not cause cooking error
Observed Result
I get cooking error every time I launch a session
Platform(s)
ALL?
Upload an image
Additional Notes
Instatiating material works from creative_device in the same project. TEST_DEVICE:
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Verse.org/Random }
TEST_DEVICE := class(creative_device):
@editable ExistingProp : ?creative_prop = false
@editable SpawnableAsset : ?creative_prop_asset = false
DynamicMaterial<private> : M_TestDynamicMaterial_material = M_TestDynamicMaterial_material{}
RefreshInterval<private> : float = 0.2
OnBegin<override>()<suspends> : void =
Sleep(1.0)
if(TheProp := ExistingProp?):
TheProp.SetMaterial(DynamicMaterial, ?Index:=0)
Print("Existing Prop: dynamic material set")
loop:
Sleep(RefreshInterval)
NewAlpha := GetRandomFloat(0.0, 1.0)
set DynamicMaterial.Alpha = NewAlpha
Print("Dynamic material Alpha set to: {NewAlpha}")