Is there a way to load the new value which set in blueprint? I tried to set properties as BlueprintReadWrite, but looks like it doesn’t work, Can someone tells me how to solve it?
Are you spawning an instance of your blueprint class, or an instance of your native class (AObstacleActor) ?
If you want your actor to have the default values of the blueprint class, you need to spawn the blueprint class.
If you are spawning from blueprint, it’s pretty trivial.
If you are spawning from c++ it’s a bit more annoying. You can use LoadClass to get the dynamic class, for prototyping :
Further down the line it is better practice to avoid hardcoded paths in code.
It would be better to declare an obstacle class property somewhere, such as in GameMode class :
Thanks a lot for solving my problem, especially the explanation of difference between native class and blueprint class, now I know the reason it doesn’t work is because I was spawning the actor with the native class, instead I should use the blueprint class, since the parameter modification was on blueprint. and I will try your advice about finding a best practice to maintain the whole code structure.