Member Functions declared with override does not override a Base Class member

I get an error "Member Functions declared with override does not override a Base Class member " I am in version 4.23 and I cannot get the AI tanks to move. I have tried everything on this lecture Q & A
The issue might be related to my blueprint. My meshes kept disappearing as did the physics material so I setup initialization at begin play. I am not sure if that related to the problem.

I tried using clamp instead of GetSafeNormal.
I tried upping the force to ungodly magnitude.
I tried deleting all NavMesh.

Please help. Also now it wont even compile properly and gives this error.

link to my github : https://github.com/TheGali/TankGame
(please note my Tank.h and Tank.CPP are Tanky.h and Tanky.cpp because I accidently named the game tank and not battletank and so the name was used up )

This is my code:

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


#include "TankTrack.h"
#include "Math/Vector.h"
#include "TankMovementComponent.h"


void UTankMovementComponent::InitializeComponent(UTankTrack* LeftTracktoSet, UTankTrack* RightTracktoSet)
{
	
	LeftTrack = LeftTracktoSet;
	RightTrack = RightTracktoSet;

}

void UTankMovementComponent::RequestDirectMove(const FVector& MoveVelocity, bool bForceMaxSpeed)
{
	//No need to call super as we're replacing the functionality

	auto TankForward = GetOwner()->GetActorForwardVector.GetSafeNormal();
	auto AIForwardIntention = MoveVelocity.GetSafeNormal();
	auto ForwardThrow = FVector::DotProduct(TankForward, AIForwardIntention);
	
	IntendMoveForward(ForwardThrow);

	//UE_LOG(LogTemp, Warning, TEXT("Forward Throw is : %s"), ForwardThrow);

}

void UTankMovementComponent::IntendMoveForward(float Throw)
{
	if (!LeftTrack || !RightTrack) { return; }
	LeftTrack->SetThrottle(Throw);
	RightTrack->SetThrottle(Throw);
	
	//TODO prevent double speed overdrive

}

void UTankMovementComponent::IntendTurnRight(float Throw)
{
	if (!LeftTrack || !RightTrack) { return; }
	LeftTrack->SetThrottle(Throw);
	RightTrack->SetThrottle(-Throw);
	//TODO prevent double speed overdrive

}

My attempt to fix issues in the BP

Sorry I missed this. You’re getting that warning message because you have a member function called “InitializeComponent” which is a virtual function which you aren’t overriding
https://docs.unrealengine.com/en-US/API/Runtime/Engine/GameFramework/UMovementComponent/InitializeComponent/index.html

You should call yours something else.

You’re also missing () on line for GetActorForwardVector()

auto TankForward = GetOwner()->GetActorForwardVector.GetSafeNormal();

That’s a bug with the engine, you should use the C++ constructor or Blueprint Construction script to assign properties.

Privacy & Terms