When I try to include “Components/InstancedSkinnedMeshComponent.h”
I get the following error when building:
InstancedSkinnedMeshComponent.h(296, 2): [C3837] attributes are not allowed in this context
Empty default c++ 5.7 project.
I’m confused why the error would be in the instanced skinned mesh component, as it’s in the engine and working. Is there something else I need to do to get access to the skeletal mesh ISM?
It is an experimental feature for the new Nanite Foliage.
Here’s an exact example of the default created component made from inheritance.
``` #pragma once
include “CoreMinimal.h” include “Components/InstancedSkinnedMeshComponent.h” include “AsmrInstancedSkinnedMeshComponent.generated.h”
UCLASS(Blueprintable, ClassGroup=(Rendering), meta=(BlueprintSpawnableComponent))
class ASMR_API UMyInstancedSkinnedMeshComponent : public UInstancedSkinnedMeshComponent
{
GENERATED_BODY()
public:
// Sets default values for this component’s properties
UMyInstancedSkinnedMeshComponent();
};
```
I haven’t got experience with the new Nanite stuff or this header, but I’ll throw some guesses out there in case they might help.
Double check that that header file itself is not part of a plugin. If it’s part of a plugin and not part of the core engine, you need to make sure to update your .cs build file to have the include for the dependency module of whatever system that’s in. I’m going to assume that the new Nanite foliage stuff might be its own plugin and its own module.
Second thing is that you need to check to see exactly what functions or features you’re looking to access or subclass. you may be better served by going further down the chain of children or maybe even up the chain i am unsure if there are some classes which epic actually don’t want people subclassing directly from they want people subclassing below or above
Finally, and I’m assuming this is correct, but just double check that you’re not calling anything else. Just try maybe in a blueprint function library, for example, to do the include. If that works, maybe try to create a child of instant skin mesh components with no other code at all. See if that works.
Thanks for the steps. It’s a standard engine component.
Empty c++ 5.7 project created from editor, with new class inheriting from InstancedSkinnedMeshComponent, (though it doesn’t even need to be inherited just having the include pops the error.
I’m now building 5.7 from source, to see if it’s something in the toolchain that’s happening since I just grabbed the binaries the standard way from the launcher.