Instanced static mesh component added through c++ performance problem
Hi guys, I have a c++ actor which has UInstancedStaticMeshComponent added with
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = GridFloor) in header file.
I created it in constructor, and updated it in PostEditChangeProperty with 2 for loop by X and Y two integer
So the InstacedStaticMeshComponent will be a grid with xsize * ysize.
When I change the size integer to 10*10 it takes almost 1~2 sec, and when i change it like 20*20,
the editor freezes like 10sec.
Below is part of my code
.cpp in Constructor
.cpp in PostEditChangeProperty
I already have made same actor through Blueprint (not derive from c++ actor), and when Update it in Construction Script, it just works fine.
when i update the grid in beginPlay, it just fine but i need it in editor, not in-game
Is this a bug? or Did i wrong somewhere??
asked Sep 13 '17 at 02:44 PM in C++ Programming
Hi Donyun Jeong Don' t use PostEditChangeProperty, instead use the equivalent Blueprint Construction Script in c++ is called OnConstruction:
answered Sep 13 '17 at 02:53 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here