My errors

firstly I am not quite shure what he included in the cpp file because it got cut off. (I wrote “Components.h”.
secondly I get the error messages that “SetUpAttachment” is not an element of UStaticMeshComponent and that I can not convert" UCapsuleComponent" to “USceneComponent” (line(15)). Are those errors existing because I included the wrong thing or what did I do wrong?

You need to include the headers for the types you are using which are UCapsuleComponent, UStaticMeshComponent, and USceneComponent.

Example:


Potentially one for Rob to edit, @sampattuzzi.

Hey, here are my includes as they were when I was recording:
#include “PawnBase.h”
#include “Components/CapsuleComponent.h”
#include “Kismet/KismetMathLibrary.h”
#include “ToonTanks/Actors/ProjectileBase.h”

Has something changed with the USceneComponent and UStaticMeshComponent? As far as I was aware, even after the change to CoreMinimal all actor classes still already start with acces to those class types so I’ve included only what was needed.

As for the original question, you should just need to add the full #nclude “Components/CapsuleComponent.h” not just “Components.h”

@julienneisius I made a quick comment above to help solve your compile issue but I’ve now located the section of video I seem to have cut out during editing that show the correct #include. Fixing that now for a reupload. Thanks for mentioning it.

It has not.

They aren’t needed to compile but IntelliSense usually requires headers for all types being used to be included. Example:


1 Like

I still get the error that SetUpAttachment is not an element of BaseMesh, TurretMesh nor ProjectileSpawnPoint. I included “Components/CapsuleComponent.h” but this didn’t solve the issue that I can’t set up an Attachment to anything. The error is called C2039.

Because it’s not. SetupAttachment. Setup is one word not two.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms