Error C3193: '%': requires '/clr' or '/ZW' command line option

does anyone know what this error means?

	virtual float TakeDamage(float DamageAmount, struct FDamageEvent const &DamageEvent, class AController *EventInstigator, AActor *DamageCauser) override;

this is the line in question that they are talking about, but i have examined it thouroughly and i don’t think there’s anything wrong with this line here, could anyone help me with this?

Could you post the full log please?

And could you show the contents of ShooterCharacter.cpp?

// Fill out your copyright notice in the Description page of Project Settings.

#include "ShooterCharacter.h"

#include "Gun.h"

// Sets default values



    // Set this character to call Tick() every frame.  You can turn this off to improve performance if you don't need it.

    PrimaryActorTick.bCanEverTick = true;


// Called when the game starts or when spawned

void AShooterCharacter::BeginPlay()




    Health = MaxHealth;

    Gun = GetWorld()->SpawnActor<AGun>(GunClass);

    GetMesh()->HideBoneByName(TEXT("weapon_r"), EPhysBodyOp::PBO_None);

    Gun->AttachToComponent(GetMesh(), FAttachmentTransformRules::KeepRelativeTransform, TEXT("WeaponSocket"));



// Called every frame

void AShooterCharacter::Tick(float DeltaTime)




// Called to bind functionality to input

void AShooterCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)



    PlayerInputComponent->BindAxis(TEXT("MoveForward"), this, &AShooterCharacter::MoveForward);

    PlayerInputComponent->BindAxis(TEXT("LookUp"), this, &APawn::AddControllerPitchInput);

    PlayerInputComponent->BindAxis(TEXT("MoveRight"), this, &AShooterCharacter::MoveRight);

    PlayerInputComponent->BindAxis(TEXT("LookRight"), this, &APawn::AddControllerYawInput);

    PlayerInputComponent->BindAction(TEXT("Jump"), EInputEvent::IE_Pressed, this, &ACharacter::Jump);

    PlayerInputComponent->BindAction(TEXT("Shoot"), EInputEvent::IE_Pressed, this, &AShooterCharacter::Shoot);


float AShooterCharacter::TakeDamage(float DamageAmount, struct FDamageEvent const %DamageEvent, class AController *EventInstigator, AActor *DamageCauser)


    float DamageToApply = Super::TakeDamage(DamageAmount, DamageEvent, EventInstigator, DamageCauser);

    DamageToApply = FMath::Min(Health, DamageToApply);

    Health -= DamageToApply;

    UE_LOG(LogTemp, Warning, TEXT("Health Left %f "), Health);

    return DamageToApply;


void AShooterCharacter::MoveForward(float AxisValue)


    AddMovementInput(GetActorForwardVector() * AxisValue);


void AShooterCharacter::MoveRight(float AxisValue)


    AddMovementInput(GetActorRightVector() * AxisValue);


void AShooterCharacter::Shoot()




//void AShooterCharacter::LookUp(float AxisValue)

// {

//  AddControllerPitchInput(AxisValue);

// }

You have a % where there should be a & here on the second parameter.

float AShooterCharacter::TakeDamage(float DamageAmount, struct FDamageEvent const %DamageEvent, class AController *EventInstigator, AActor *DamageCauser)

thank you, this solved my issue.

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

Privacy & Terms