still doesn’t work
What’s the errors now?
its the same thing
Copy you projectil.cop and past it here
im gonna post it anyways because maybe theres something different File C:\Users\Aidan\OneDrive\Desktop\ToonTanksProjectSetup_4.25\ToonTanks\Intermediate\Build\Win64\UnrealEditor\Development\ToonTanks\BasePawn.cpp.obj was modified or is new File C:\Users\Aidan\OneDrive\Desktop\ToonTanksProjectSetup_4.25\ToonTanks\Intermediate\Build\Win64\UnrealEditor\Development\ToonTanks\Projectile.cpp.obj was modified or is new File C:\Users\Aidan\OneDrive\Desktop\ToonTanksProjectSetup_4.25\ToonTanks\Intermediate\Build\Win64\UnrealEditor\Development\ToonTanks\Projectile.gen.cpp.obj was modified or is new File C:\Users\Aidan\OneDrive\Desktop\ToonTanksProjectSetup_4.25\ToonTanks\Intermediate\Build\Win64\UnrealEditor\Development\ToonTanks\ToonTanks.init.gen.cpp.obj was modified or is new Building patch from 4 file(s) for Live coding module C:\Users\Aidan\OneDrive\Desktop\ToonTanksProjectSetup_4.25\ToonTanks\Binaries\Win64\UnrealEditor-ToonTanks.dll Creating library C:\Users\Aidan\OneDrive\Desktop\ToonTanksProjectSetup_4.25\ToonTanks\Binaries\Win64\UnrealEditor-ToonTanks.patch_0.lib and object C:\Users\Aidan\OneDrive\Desktop\ToonTanksProjectSetup_4.25\ToonTanks\Binaries\Win64\UnrealEditor-ToonTanks.patch_0.exp BasePawn.cpp.obj : error LNK2019: unresolved external symbol "private: static class UClass * __cdecl ABasePawn::GetPrivateStaticClass(void)" (?GetPrivateStaticClass@ABasePawn@@CAPEAVUClass@@XZ) referenced in function "public: static void * __cdecl ABasePawn::operator new(unsigned __int64,enum EInternal,class UObject *,class FName,enum EObjectFlags)" (??2ABasePawn@@SAPEAX_KW4EInternal@@PEAVUObject@@VFName@@W4EObjectFlags@@@Z) BasePawn.cpp.obj : error LNK2019: unresolved external symbol "public: __cdecl ABasePawn::ABasePawn(class FVTableHelper &)" (??0ABasePawn@@QEAA@AEAVFVTableHelper@@@Z) referenced in function "public: static class UObject * __cdecl ABasePawn::__VTableCtorCaller(class FVTableHelper &)" (?__VTableCtorCaller@ABasePawn@@SAPEAVUObject@@AEAVFVTableHelper@@@Z) C:\Users\Aidan\OneDrive\Desktop\ToonTanksProjectSetup_4.25\ToonTanks\Binaries\Win64\UnrealEditor-ToonTanks.patch_0.exe : fatal error LNK1120: 2 unresolved externals
ok
// Fill out your copyright notice in the Description page of Project Settings.
#include "Projectile.h"
#include "Components/StaticMeshComponent.h"
#include "GameFramework/ProjectileMovementComponent.h"
// Sets default values
AProjectile::AProjectile()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = false;
ProjectileMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Projectile Mesh"));
RootComponent = ProjectileMesh;
MovementComp = CreateDefaultSubobject<UProjectileMovementComponent>(TEXT("Movement Component"));
MovementComp->MaxSpeed = 1300.f;
MovementComp->InitialSpeed = 1300.f;
}
// Called when the game starts or when spawned
void AProjectile::BeginPlay()
{
Super::BeginPlay();
ProjectileMesh->OnComponentHit.AddDynamic(this, &AProjectile::OnHit);
}
// Called every frame
void AProjectile::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
void AProjectile::OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& HitResult)
{
UE_LOG(LogTemp, Display, TEXT("OtherActor: %s"), *OtherActor->GetName());
}
The problem is now in basepawn the projectile one is gone. The last time you had 3 errors now you only got 2
well since its erroring with the compile the blueprints dont inherit from anything anymore it shouldnt be complaining about that
bc i cant set it
Let me see your basepawn.cpp and .h
// Fill out your copyright notice in the Description page of Project Settings.
#include "BasePawn.h"
#include "Components/CapsuleComponent.h"
#include "Kismet/GameplayStatics.h"
#include "Components/StaticMeshComponent.h"
#include "Projectile.h"
// Sets default values
ABasePawn::ABasePawn()
{
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
CapsuleComp = CreateDefaultSubobject<UCapsuleComponent>(TEXT("Capsule Collider"));
RootComponent = CapsuleComp;
BaseMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Base Mesh"));
BaseMesh->SetupAttachment(CapsuleComp);
TurretMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Turret Mesh"));
TurretMesh->SetupAttachment(BaseMesh);
ProjectileSpawnPoint = CreateDefaultSubobject<USceneComponent>(TEXT("Projectile Spawn Point"));
ProjectileSpawnPoint->SetupAttachment(TurretMesh);
}
void ABasePawn::RotateTurret(FVector LookAtTarget)
{
FVector ToTarget = LookAtTarget - TurretMesh->GetComponentLocation();
FRotator LookAtRotation = FRotator(0.f, ToTarget.Rotation().Yaw, 0.f);
TurretMesh->SetWorldRotation(
FMath::RInterpTo(
TurretMesh->GetComponentRotation(),
LookAtRotation,
UGameplayStatics::GetWorldDeltaSeconds(this),
5.f));
}
void ABasePawn::Fire()
{
//get the projectile location and the projectile rotation
FVector ProjectileSpawnPointLocation = ProjectileSpawnPoint->GetComponentLocation();
FRotator ProjectileSpawnPointRotation = ProjectileSpawnPoint->GetComponentRotation();
//spawns the projectile with the projectile location and the projectile rotation
GetWorld()->SpawnActor<AProjectile>(
ProjectileClass,
ProjectileSpawnPointLocation,
ProjectileSpawnPointRotation);
}
heres the h
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "BasePawn.generated.h"
UCLASS()
class TOONTANKS_API ABasePawn : public APawn
{
GENERATED_BODY()
public:
// Sets default values for this pawn's properties
ABasePawn();
protected:
void RotateTurret(FVector LookAtTarget);
void Fire();
private:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components", meta = (AllowPrivateAccess = "true"))
class UCapsuleComponent *CapsuleComp;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components", meta = (AllowPrivateAccess = "true"))
UStaticMeshComponent *BaseMesh;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components", meta = (AllowPrivateAccess = "true"))
UStaticMeshComponent *TurretMesh;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components", meta = (AllowPrivateAccess = "true"))
USceneComponent *ProjectileSpawnPoint;
UPROPERTY(EditDefaultsOnly, Category="Combat")
TSubclassOf<class AProjectile> ProjectileClass;
};
I’m not sure sorry. I would revert to my previous commit at this stage. I hope you figure it out. You can try to delete the binaries, intermediate and saved folders from your project directory and regenerate visual studio project files then do a build. I have had that fix some issues with unreal.
ok well im just gonna go through all my code
The symbol it’s talking about should be in code generated by Unreal. I suggest you delete the Intermediate folder and then recompile, deleting that folder should force Unreal to regenerate the generated code.
ill try
its giving me this now:
ERROR: Unable to patch action graph - unexpected executable in compile action (C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\rc.exe)
i fixed it and my classes are gone but still in source
Thanks for you guys who helped me I have now solved the problem by restarted my pc and deleting binary folder and intermediate seperately 