error : Inappropriate keyword 'static' on variable of type 'TMap'

Im trying to add a static Map variable to hold defaults values of a custom structure, but it just won’t compile because of the error. Here are some images (ignore the coments, there are there just in case i have to undo to see it before)

The log with the error

The line of the error

I also tried to let it un initzialized but it stil shows the same error

PD: the penetrationStruct is defined inside of mesh component

You can’t have UPROPERTY’s that are static. That’s just how Unreal works.

Why are you doing this? it looks like you’re duplicating the functionality the engine already provides.
When you make a custom structure, all the defaults would be specified as a) inline initializers in the header, b) in a constructor, c) edited in the blueprint version of the class or d) configured through an ini.
The class or struct will then have a Class Default Object (CDO) with all the default values.
You can get at that object whenever you want so you don’t have to store the defaults yourself.

1 Like

I needed the default properties of a custom struct for each mesh, I didn’t want it to set the values for every instance. I wanted to add the ability of set default values based on the static mesh, and override them if needed