Adding More Variable Types to PhysicalMaterial.h

Hi :wave:

I’d like to add a couple of more variable types (such as material instances and sounds) to the default PhysicalMaterial.h file so that I could retrieve them after shooting an object, for example, and use them to spawn sounds, bullet hole decals, etc. instead of having to look for the physical material in a library and then retrieving the variables from there as it would be a lot easier and better for performance to add the variables directly to the PhysicalMaterial.h class.

The problem is that if I add any variables that are not simple floats, booleans, integers, etc. I cannot compile the engine. I get all kinds of errors. :man_shrugging:

I’ve tried including the EngineTypes.h.h and Actor.h files in the PhysicalMaterial.h, but it didn’t help.

Is it possible to add any other variables, such as sounds, to the PhysicalMaterial.h file, or am I wasting my time?

Thanks!

You can add is the short answerr but why you want to do them in that ? Still if you show the compilation error we can take a look. I bet it needs physicscore.

What I would recommend though in terrms of this mechanics.

Make a base impact class that is spawned on a valid impact and just gets hit data from projectile or hitscan.

And on that class you can branch your things like sounds, decals, phsyics volumes, vfx and whatver rather than doing it in physical material .h

This way actually is very nice even if you want to push forward you can use that for footsteps, punches in the game which I do also, so you don’t have to think later on what happens when you hit/impact something, it becomes a logical container.

So, I added

#include "GameFramework/Actor.h"

To the header of PhysicalMaterial.h. My reasoning behind this is that it should drag any additional classes needed for the variables with it.

Then I added a new Material Instance variable:

UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = PhysicalProperties)
UMaterialInterface* TestInstance;

Upon compilation I get hundreds of errors from the seemingly unrelated files, mainly from InputCoreTypes.h.

I’ll post them here but the list is very long.

Severity	Code	Description	Project	File	Line	Suppression State
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	138	
Error (active)	E0145	member "FixedTagPrivate::FMapHandle::StoreIndexBits" may not be initialized	UE4	...\CoreUObject\Public\AssetRegistry\AssetDataTagMap.h	110	
Error (active)	E0028	expression must have a constant value	UE4	...\CoreUObject\Public\AssetRegistry\AssetDataTagMap.h	114	
Error (active)	E0145	member "FBulkDataStreamingToken::InvalidOffset" may not be initialized	UE4	...\CoreUObject\Public\Serialization\BulkData.h	132	
Error (active)	E0145	member "FBulkDataBase::InvalidToken" may not be initialized	UE4	...\CoreUObject\Public\Serialization\BulkData2.h	125	
Error (active)	E1574	static assertion failed with "TAtomic is only usable with trivial types"	UE4	...\Core\Public\Templates\Atomic.h	543	
Error (active)	E0145	member "FName::StringBufferSize" may not be initialized	UE4	...\Core\Public\UObject\NameTypes.h	471	
Error (active)	E0145	member "FNavigationLinkBase::InvalidUserId" may not be initialized	UE4	...\Engine\Classes\AI\Navigation\NavLinkDefinition.h	40	
Error (active)	E0145	member "FRayTracingGeometry::NonSharedVertexBuffers" may not be initialized	UE4	...\RenderCore\Public\RenderResource.h	665	
Error (active)	E0145	member "FShaderParameterBindings::kInvalidBufferIndex" may not be initialized	UE4	...\RenderCore\Public\Shader.h	601	
Error	C2061	syntax error: identifier 'UScriptStruct'	...	...\Intermediate\Build\Win64\UE4Editor\Inc\InputCore\InputCoreTypes.generated.h	22	
Error	C2061	syntax error: identifier 'UClass'	...	...\Intermediate\Build\Win64\UE4Editor\Inc\InputCore\InputCoreTypes.generated.h	97	
Error	C2061	syntax error: identifier 'UEnum'	...	...\Intermediate\Build\Win64\UE4Editor\Inc\InputCore\InputCoreTypes.generated.h	149	
Error	C2143	syntax error: missing ';' before 'identifier'	...	...\InputCore\Classes\InputCoreTypes.h	12	
Error	C2144	syntax error: 'FLogCategoryLogInput' should be preceded by ';'	...	...\InputCore\Classes\InputCoreTypes.h	12	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	12	
Error	C3433	'EControllerHand': all declarations of an enumeration must have the same underlying type, was 'unsigned char' now 'int'	...	...\InputCore\Classes\InputCoreTypes.h	38	
Error	C2079	'FKey' uses undefined struct 'INPUTCORE_API'	...	...\InputCore\Classes\InputCoreTypes.h	50	
Error	C2255	'friend': not allowed outside of a class definition	...	...\InputCore\Classes\InputCoreTypes.h	51	
Error	C2062	type 'Z_Construct_UScriptStruct_FKey_Statics' unexpected	...	...\InputCore\Classes\InputCoreTypes.h	51	
Error	C2989	'UScriptStruct': class template has already been declared as a non-class template	...	...\InputCore\Classes\InputCoreTypes.h	51	
Error	C2132	syntax error: unexpected identifier	...	...\InputCore\Classes\InputCoreTypes.h	51	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	54	
Error	C2373	'FKey': redefinition; different type modifiers	...	...\InputCore\Classes\InputCoreTypes.h	53	
Error	C4508	'FKey': function should return a value; 'void' return type assumed	...	...\InputCore\Classes\InputCoreTypes.h	55	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	58	
Error	C2373	'FKey': redefinition; different type modifiers	...	...\InputCore\Classes\InputCoreTypes.h	57	
Error	C2550	'FKey': constructor initializer lists are only allowed on constructor definitions	...	...\InputCore\Classes\InputCoreTypes.h	59	
Error	C4508	'FKey': function should return a value; 'void' return type assumed	...	...\InputCore\Classes\InputCoreTypes.h	60	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	63	
Error	C2373	'FKey': redefinition; different type modifiers	...	...\InputCore\Classes\InputCoreTypes.h	62	
Error	C2550	'FKey': constructor initializer lists are only allowed on constructor definitions	...	...\InputCore\Classes\InputCoreTypes.h	64	
Error	C4508	'FKey': function should return a value; 'void' return type assumed	...	...\InputCore\Classes\InputCoreTypes.h	65	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	68	
Error	C2373	'FKey': redefinition; different type modifiers	...	...\InputCore\Classes\InputCoreTypes.h	67	
Error	C2550	'FKey': constructor initializer lists are only allowed on constructor definitions	...	...\InputCore\Classes\InputCoreTypes.h	69	
Error	C4508	'FKey': function should return a value; 'void' return type assumed	...	...\InputCore\Classes\InputCoreTypes.h	70	
Error	C2270	'IsValid': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	72	
Error	C2270	'IsModifierKey': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	73	
Error	C2270	'IsGamepadKey': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	74	
Error	C2270	'IsTouch': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	75	
Error	C2270	'IsMouseButton': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	76	
Error	C2270	'IsButtonAxis': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	77	
Error	C2270	'IsAxis1D': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	78	
Error	C2270	'IsAxis2D': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	79	
Error	C2270	'IsAxis3D': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	80	
Error	C2270	'IsFloatAxis': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	82	
Error	C2270	'IsVectorAxis': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	84	
Error	C2270	'IsDigital': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	85	
Error	C2270	'IsAnalog': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	86	
Error	C2270	'IsBindableInBlueprints': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	87	
Error	C2270	'ShouldUpdateAxisWithoutSamples': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	88	
Error	C2270	'IsBindableToActions': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	89	
Error	C2270	'IsDeprecated': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	90	
Error	C2270	'GetDisplayName': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	91	
Error	C2270	'ToString': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	92	
Error	C2270	'GetFName': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	93	
Error	C2270	'GetMenuCategory': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	94	
Error	C2270	'GetPairedAxis': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	95	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	96	
Error	C2086	'int FKey': redefinition	...	...\InputCore\Classes\InputCoreTypes.h	96	
Error	C2146	syntax error: missing ';' before identifier 'GetPairedAxisKey'	...	...\InputCore\Classes\InputCoreTypes.h	96	
Error	C2061	syntax error: identifier 'FKey'	...	...\InputCore\Classes\InputCoreTypes.h	99	
Error	C2270	'ExportTextItem': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	99	
Error	C2255	'friend': not allowed outside of a class definition	...	...\InputCore\Classes\InputCoreTypes.h	104	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	104	
Error	C2988	unrecognizable template declaration/definition	...	...\InputCore\Classes\InputCoreTypes.h	104	
Error	C2143	syntax error: missing ',' before '&'	...	...\InputCore\Classes\InputCoreTypes.h	104	
Error	C2803	'operator ==' must have at least one formal parameter of class type	...	...\InputCore\Classes\InputCoreTypes.h	104	
Error	C2805	binary 'operator ==' has too few parameters	...	...\InputCore\Classes\InputCoreTypes.h	104	
Error	C4459	declaration of 'FKey' hides global declaration	...	...\InputCore\Classes\InputCoreTypes.h	104	
Error	C2065	'KeyA': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	104	
Error	C2065	'KeyB': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	104	
Error	C2255	'friend': not allowed outside of a class definition	...	...\InputCore\Classes\InputCoreTypes.h	105	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	105	
Error	C2988	unrecognizable template declaration/definition	...	...\InputCore\Classes\InputCoreTypes.h	105	
Error	C2143	syntax error: missing ',' before '&'	...	...\InputCore\Classes\InputCoreTypes.h	105	
Error	C2803	'operator !=' must have at least one formal parameter of class type	...	...\InputCore\Classes\InputCoreTypes.h	105	
Error	C2805	binary 'operator !=' has too few parameters	...	...\InputCore\Classes\InputCoreTypes.h	105	
Error	C4459	declaration of 'FKey' hides global declaration	...	...\InputCore\Classes\InputCoreTypes.h	105	
Error	C2065	'KeyA': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	105	
Error	C2065	'KeyB': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	105	
Error	C2255	'friend': not allowed outside of a class definition	...	...\InputCore\Classes\InputCoreTypes.h	106	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	106	
Error	C2988	unrecognizable template declaration/definition	...	...\InputCore\Classes\InputCoreTypes.h	106	
Error	C2143	syntax error: missing ',' before '&'	...	...\InputCore\Classes\InputCoreTypes.h	106	
Error	C2803	'operator <' must have at least one formal parameter of class type	...	...\InputCore\Classes\InputCoreTypes.h	106	
Error	C2805	binary 'operator <' has too few parameters	...	...\InputCore\Classes\InputCoreTypes.h	106	
Error	C4459	declaration of 'FKey' hides global declaration	...	...\InputCore\Classes\InputCoreTypes.h	106	
Error	C2065	'KeyA': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	106	
Error	C2065	'KeyB': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	106	
Error	C2255	'friend': not allowed outside of a class definition	...	...\InputCore\Classes\InputCoreTypes.h	107	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	107	
Error	C2988	unrecognizable template declaration/definition	...	...\InputCore\Classes\InputCoreTypes.h	107	
Error	C2143	syntax error: missing ',' before '&'	...	...\InputCore\Classes\InputCoreTypes.h	107	
Error	C2084	function 'uint32 GetTypeHash(const int32)' already has a body	...	...\InputCore\Classes\InputCoreTypes.h	107	
Error	C4459	declaration of 'FKey' hides global declaration	...	...\InputCore\Classes\InputCoreTypes.h	107	
Error	C2065	'Key': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	107	
Error	C2255	'friend': not allowed outside of a class definition	...	...\InputCore\Classes\InputCoreTypes.h	109	
Error	C2988	unrecognizable template declaration/definition	...	...\InputCore\Classes\InputCoreTypes.h	113	
Error	C2059	syntax error: 'private'	...	...\InputCore\Classes\InputCoreTypes.h	113	
Error	C2178	'KeyDetails' cannot be declared with 'mutable' specifier	...	...\InputCore\Classes\InputCoreTypes.h	118	
Error	C2270	'ConditionalLookupKeyDetails': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	120	
Error	C2988	unrecognizable template declaration/definition	...	...\InputCore\Classes\InputCoreTypes.h	122	
Error	C2059	syntax error: '}'	...	...\InputCore\Classes\InputCoreTypes.h	122	
Error	C2143	syntax error: missing ';' before '}'	...	...\InputCore\Classes\InputCoreTypes.h	122	
Error	C2923	'TStructOpsTypeTraits': 'FKey' is not a valid template type argument for parameter 'CPPSTRUCT'	...	...\InputCore\Classes\InputCoreTypes.h	125	
Error	C2913	explicit specialization; 'TStructOpsTypeTraits' is not a specialization of a class template	...	...\InputCore\Classes\InputCoreTypes.h	136	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	138	
Error	C2990	'INPUTCORE_API': non-class template has already been declared as a class template	...	...\InputCore\Classes\InputCoreTypes.h	141	
Error	C2079	'FKeyDetails' uses undefined struct 'INPUTCORE_API'	...	...\InputCore\Classes\InputCoreTypes.h	141	
Error	C2065	'GamepadKey': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	144	
Error	C2065	'Touch': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	145	
Error	C2065	'MouseButton': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	146	
Error	C2065	'ModifierKey': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	147	
Error	C2065	'NotBlueprintBindableKey': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	148	
Error	C2065	'Axis1D': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	149	
Error	C2065	'Axis3D': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	150	
Error	C2065	'UpdateAxisWithoutSamples': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	151	
Error	C2065	'NotActionBindableKey': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	152	
Error	C2065	'Deprecated': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	153	
Error	C2065	'ButtonAxis': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	156	
Error	C2065	'Axis2D': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	157	
Error	C2065	'FloatAxis': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	161	
Error	C2059	syntax error: 'attribute specifier'	...	...\InputCore\Classes\InputCoreTypes.h	161	
Error	C2143	syntax error: missing ';' before '}'	...	...\InputCore\Classes\InputCoreTypes.h	165	
Error	C2059	syntax error: '}'	...	...\InputCore\Classes\InputCoreTypes.h	165	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	167	
Error	C2146	syntax error: missing ')' before identifier 'InKey'	...	...\InputCore\Classes\InputCoreTypes.h	167	
Error	C3646	'InKey': unknown override specifier	...	...\InputCore\Classes\InputCoreTypes.h	167	
Error	C2373	'FKeyDetails': redefinition; different type modifiers	...	...\InputCore\Classes\InputCoreTypes.h	167	
Error	C1003	error count exceeds 100; stopping compilation	...	...\InputCore\Classes\InputCoreTypes.h	167	
Error	C2061	syntax error: identifier 'UScriptStruct'	...	...\Intermediate\Build\Win64\UE4Editor\Inc\InputCore\InputCoreTypes.generated.h	22	
Error	C2061	syntax error: identifier 'UClass'	...	...\Intermediate\Build\Win64\UE4Editor\Inc\InputCore\InputCoreTypes.generated.h	97	
Error	C2061	syntax error: identifier 'UEnum'	...	...\Intermediate\Build\Win64\UE4Editor\Inc\InputCore\InputCoreTypes.generated.h	149	
Error	C2143	syntax error: missing ';' before 'identifier'	...	...\InputCore\Classes\InputCoreTypes.h	12	
Error	C2144	syntax error: 'FLogCategoryLogInput' should be preceded by ';'	...	...\InputCore\Classes\InputCoreTypes.h	12	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	12	
Error	C3433	'EControllerHand': all declarations of an enumeration must have the same underlying type, was 'unsigned char' now 'int'	...	...\InputCore\Classes\InputCoreTypes.h	38	
Error	C2079	'FKey' uses undefined struct 'INPUTCORE_API'	...	...\InputCore\Classes\InputCoreTypes.h	50	
Error	C2255	'friend': not allowed outside of a class definition	...	...\InputCore\Classes\InputCoreTypes.h	51	
Error	C2062	type 'Z_Construct_UScriptStruct_FKey_Statics' unexpected	...	...\InputCore\Classes\InputCoreTypes.h	51	
Error	C2989	'UScriptStruct': class template has already been declared as a non-class template	...	...\InputCore\Classes\InputCoreTypes.h	51	
Error	C2132	syntax error: unexpected identifier	...	...\InputCore\Classes\InputCoreTypes.h	51	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	54	
Error	C2373	'FKey': redefinition; different type modifiers	...	...\InputCore\Classes\InputCoreTypes.h	53	
Error	C4508	'FKey': function should return a value; 'void' return type assumed	...	...\InputCore\Classes\InputCoreTypes.h	55	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	58	
Error	C2373	'FKey': redefinition; different type modifiers	...	...\InputCore\Classes\InputCoreTypes.h	57	
Error	C2550	'FKey': constructor initializer lists are only allowed on constructor definitions	...	...\InputCore\Classes\InputCoreTypes.h	59	
Error	C4508	'FKey': function should return a value; 'void' return type assumed	...	...\InputCore\Classes\InputCoreTypes.h	60	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	63	
Error	C2373	'FKey': redefinition; different type modifiers	...	...\InputCore\Classes\InputCoreTypes.h	62	
Error	C2550	'FKey': constructor initializer lists are only allowed on constructor definitions	...	...\InputCore\Classes\InputCoreTypes.h	64	
Error	C4508	'FKey': function should return a value; 'void' return type assumed	...	...\InputCore\Classes\InputCoreTypes.h	65	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	68	
Error	C2373	'FKey': redefinition; different type modifiers	...	...\InputCore\Classes\InputCoreTypes.h	67	
Error	C2550	'FKey': constructor initializer lists are only allowed on constructor definitions	...	...\InputCore\Classes\InputCoreTypes.h	69	
Error	C4508	'FKey': function should return a value; 'void' return type assumed	...	...\InputCore\Classes\InputCoreTypes.h	70	
Error	C2270	'IsValid': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	72	
Error	C2270	'IsModifierKey': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	73	
Error	C2270	'IsGamepadKey': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	74	
Error	C2270	'IsTouch': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	75	
Error	C2270	'IsMouseButton': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	76	
Error	C2270	'IsButtonAxis': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	77	
Error	C2270	'IsAxis1D': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	78	
Error	C2270	'IsAxis2D': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	79	
Error	C2270	'IsAxis3D': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	80	
Error	C2270	'IsFloatAxis': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	82	
Error	C2270	'IsVectorAxis': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	84	
Error	C2270	'IsDigital': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	85	
Error	C2270	'IsAnalog': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	86	
Error	C2270	'IsBindableInBlueprints': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	87	
Error	C2270	'ShouldUpdateAxisWithoutSamples': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	88	
Error	C2270	'IsBindableToActions': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	89	
Error	C2270	'IsDeprecated': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	90	
Error	C2270	'GetDisplayName': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	91	
Error	C2270	'ToString': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	92	
Error	C2270	'GetFName': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	93	
Error	C2270	'GetMenuCategory': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	94	
Error	C2270	'GetPairedAxis': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	95	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	96	
Error	C2086	'int FKey': redefinition	...	...\InputCore\Classes\InputCoreTypes.h	96	
Error	C2146	syntax error: missing ';' before identifier 'GetPairedAxisKey'	...	...\InputCore\Classes\InputCoreTypes.h	96	
Error	C2061	syntax error: identifier 'FKey'	...	...\InputCore\Classes\InputCoreTypes.h	99	
Error	C2270	'ExportTextItem': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	99	
Error	C2255	'friend': not allowed outside of a class definition	...	...\InputCore\Classes\InputCoreTypes.h	104	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	104	
Error	C2988	unrecognizable template declaration/definition	...	...\InputCore\Classes\InputCoreTypes.h	104	
Error	C2143	syntax error: missing ',' before '&'	...	...\InputCore\Classes\InputCoreTypes.h	104	
Error	C2803	'operator ==' must have at least one formal parameter of class type	...	...\InputCore\Classes\InputCoreTypes.h	104	
Error	C2805	binary 'operator ==' has too few parameters	...	...\InputCore\Classes\InputCoreTypes.h	104	
Error	C4459	declaration of 'FKey' hides global declaration	...	...\InputCore\Classes\InputCoreTypes.h	104	
Error	C2065	'KeyA': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	104	
Error	C2065	'KeyB': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	104	
Error	C2255	'friend': not allowed outside of a class definition	...	...\InputCore\Classes\InputCoreTypes.h	105	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	105	
Error	C2988	unrecognizable template declaration/definition	...	...\InputCore\Classes\InputCoreTypes.h	105	
Error	C2143	syntax error: missing ',' before '&'	...	...\InputCore\Classes\InputCoreTypes.h	105	
Error	C2803	'operator !=' must have at least one formal parameter of class type	...	...\InputCore\Classes\InputCoreTypes.h	105	
Error	C2805	binary 'operator !=' has too few parameters	...	...\InputCore\Classes\InputCoreTypes.h	105	
Error	C4459	declaration of 'FKey' hides global declaration	...	...\InputCore\Classes\InputCoreTypes.h	105	
Error	C2065	'KeyA': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	105	
Error	C2065	'KeyB': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	105	
Error	C2255	'friend': not allowed outside of a class definition	...	...\InputCore\Classes\InputCoreTypes.h	106	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	106	
Error	C2988	unrecognizable template declaration/definition	...	...\InputCore\Classes\InputCoreTypes.h	106	
Error	C2143	syntax error: missing ',' before '&'	...	...\InputCore\Classes\InputCoreTypes.h	106	
Error	C2803	'operator <' must have at least one formal parameter of class type	...	...\InputCore\Classes\InputCoreTypes.h	106	
Error	C2805	binary 'operator <' has too few parameters	...	...\InputCore\Classes\InputCoreTypes.h	106	
Error	C4459	declaration of 'FKey' hides global declaration	...	...\InputCore\Classes\InputCoreTypes.h	106	
Error	C2065	'KeyA': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	106	
Error	C2065	'KeyB': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	106	
Error	C2255	'friend': not allowed outside of a class definition	...	...\InputCore\Classes\InputCoreTypes.h	107	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	107	
Error	C2988	unrecognizable template declaration/definition	...	...\InputCore\Classes\InputCoreTypes.h	107	
Error	C2143	syntax error: missing ',' before '&'	...	...\InputCore\Classes\InputCoreTypes.h	107	
Error	C2084	function 'uint32 GetTypeHash(const int32)' already has a body	...	...\InputCore\Classes\InputCoreTypes.h	107	
Error	C4459	declaration of 'FKey' hides global declaration	...	...\InputCore\Classes\InputCoreTypes.h	107	
Error	C2065	'Key': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	107	
Error	C2255	'friend': not allowed outside of a class definition	...	...\InputCore\Classes\InputCoreTypes.h	109	
Error	C2988	unrecognizable template declaration/definition	...	...\InputCore\Classes\InputCoreTypes.h	113	
Error	C2059	syntax error: 'private'	...	...\InputCore\Classes\InputCoreTypes.h	113	
Error	C2178	'KeyDetails' cannot be declared with 'mutable' specifier	...	...\InputCore\Classes\InputCoreTypes.h	118	
Error	C2270	'ConditionalLookupKeyDetails': modifiers not allowed on nonmember functions	...	...\InputCore\Classes\InputCoreTypes.h	120	
Error	C2988	unrecognizable template declaration/definition	...	...\InputCore\Classes\InputCoreTypes.h	122	
Error	C2059	syntax error: '}'	...	...\InputCore\Classes\InputCoreTypes.h	122	
Error	C2143	syntax error: missing ';' before '}'	...	...\InputCore\Classes\InputCoreTypes.h	122	
Error	C2923	'TStructOpsTypeTraits': 'FKey' is not a valid template type argument for parameter 'CPPSTRUCT'	...	...\InputCore\Classes\InputCoreTypes.h	125	
Error	C2913	explicit specialization; 'TStructOpsTypeTraits' is not a specialization of a class template	...	...\InputCore\Classes\InputCoreTypes.h	136	
Error	C2990	'INPUTCORE_API': non-class template has already been declared as a class template	...	...\InputCore\Classes\InputCoreTypes.h	141	
Error	C2079	'FKeyDetails' uses undefined struct 'INPUTCORE_API'	...	...\InputCore\Classes\InputCoreTypes.h	141	
Error	C2065	'GamepadKey': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	144	
Error	C2065	'Touch': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	145	
Error	C2065	'MouseButton': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	146	
Error	C2065	'ModifierKey': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	147	
Error	C2065	'NotBlueprintBindableKey': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	148	
Error	C2065	'Axis1D': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	149	
Error	C2065	'Axis3D': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	150	
Error	C2065	'UpdateAxisWithoutSamples': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	151	
Error	C2065	'NotActionBindableKey': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	152	
Error	C2065	'Deprecated': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	153	
Error	C2065	'ButtonAxis': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	156	
Error	C2065	'Axis2D': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	157	
Error	C2065	'FloatAxis': undeclared identifier	...	...\InputCore\Classes\InputCoreTypes.h	161	
Error	C2059	syntax error: 'attribute specifier'	...	...\InputCore\Classes\InputCoreTypes.h	161	
Error	C2143	syntax error: missing ';' before '}'	...	...\InputCore\Classes\InputCoreTypes.h	165	
Error	C2059	syntax error: '}'	...	...\InputCore\Classes\InputCoreTypes.h	165	
Error	C4430	missing type specifier - int assumed. Note: C++ does not support default-int	...	...\InputCore\Classes\InputCoreTypes.h	167	
Error	C2146	syntax error: missing ')' before identifier 'InKey'	...	...\InputCore\Classes\InputCoreTypes.h	167	
Error	C3646	'InKey': unknown override specifier	...	...\InputCore\Classes\InputCoreTypes.h	167	
Error	C2373	'FKeyDetails': redefinition; different type modifiers	...	...\InputCore\Classes\InputCoreTypes.h	167	
Error	C1003	error count exceeds 100; stopping compilation	...	...\InputCore\Classes\InputCoreTypes.h	167	
Warning	C4005	'TEXT': macro redefinition	...	C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winnt.h	603	
Warning	C4996	'GIsRequestingExit': Please use IsEngineExitRequested()/RequestEngineExit(const FString&) Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.	...	L:\...\Source\...\Private\BPFL_FunctionLibraryTaviana.cpp	249	
Warning	C4005	'TEXT': macro redefinition	...	C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winnt.h	603	
Error	MSB3073	The command "...\Build\BatchFiles\Build.bat -Target="...Editor Win64 Development -Project=\"L:\...\....uproject\"" -Target="ShaderCompileWorker Win64 Development -Quiet" -WaitMutex -FromMsBuild" exited with code 6.	...	C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets	44	

I tried making a child class of PhysicalMaterial.h, but the engine does not allow you to reparent physical material assets or create new ones based on that class, so you can’t assign them to your meshes.

alllright, not sure to be honest however would like to dig into it a bit, so I will build engine from source to check it.

Thank you very much! I’m sure that this will help countless people optimize their games. :man_bowing:

1 Like

Hey there,

So I was able to add some variables to PhysicalMaterial.h . I also tried to add something more complex like a MaterialInterface as you do with include “Materials/MaterialInterface.h”
reference to it and had no problems (with my limited knowledge)

	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = PhysicalProperties)
	TSoftObjectPtr<UMaterialInterface> TestInstance;

Also you need to add Engine dependency to PhysicsCore.Build.cs or if there is a dependency.

When I directly edited the builded engine code however I get errors similar to your output, however when I build the engine from source have no issues as modified engine.

For that please https://github.com/EpicGames/UnrealEngine access to Epic organisation and access UE source and follow the instructions to build from source. After that you can modify the code as allows. You want to contribute to Unreal Engine? Here’s how!

This being said, I would like to give a heads up for couple of things, just as opinion.
As logic I would expect here to have phsyics properties and coralated things as another class, like sound etc.

However If I was building a physics related feature in Engine, let’s say Sound Propagation which is coralated with porosity and density I would expect it to be listed here. That is a nice feature important for some of the competetive games like Siege. Can be many other physical properties like hardness etc. not subject of the this thread.

Or let’s say I want to build a new physics feature as Heat Dispersion. I would expect to see Heat Dispersion Coefficient to be here as well as melting point , freezing point etc. So in future I can add that to world landscape material and if there is a heatsource in game like a fireplace, I can do various things with physics like: melting snow, increasing the damage received from fire with distance, changing material visual effects like red hot metal etc. gameplay mechanics, like make stamina drain faster if you are in a very cold zone :smiley: Many possibilities so it creates even more believable world with minimal effort.

However I would not expect to see a SoundFile, as physical material property, however can be if you need to, Imo those can be another class.

Let me know if this was helpfull.

PS: Thanks also your question push me to make space and time for building the source in my local development space.