Serious logistic issues and none functioning end result

Hi Ben,
In this video, you put the TickComponent() in but completely got side tracked with checking the UE_LOG. I can’t see the ticking ever worked in the log and before you resolve that, you just deleted the UE_LOG and put in the if statement on setting EFiringStatus enum. At the end of the video, my firing isn’t working at all.
The logic in that if statement is also very troubling. Reloading should be set (FPlatformTime::Seconds() - lastFireTime) < reloadTimeInSeconds and not greater than (which is the way you left it at in the video). Because reloading means it’s not ready to fire and not the other way around. I have looked through your commit and can’t find any answer to these questions. Please review this video. Thanks!

If your TickComponent isn’t working, try deleting and re-adding the component on your actor. This fixed it for me, and was quite frustrating to figure out.

4 Likes

Thank you Carson! That fixed the none working TickComponent issue for me. UE4 is so buggy.

thanks too.
Same error and same solution for me

I am getting the exact same problem, I have tried removing and re adding the function, I assume that’s what you meant by re adding the component, but still no ticking.
My header File:

private:
	virtual void BeginPlay() override;
	virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override;

and the relevant bits of the cpp:

UTankAimingComponent::UTankAimingComponent()
{
	// Set this component to be initialized when the game starts, and to be ticked every frame.  You can turn these features
	// off to improve performance if you don't need them.
	bWantsBeginPlay = true;
	PrimaryComponentTick.bCanEverTick = true;

	// ...
}


void UTankAimingComponent::BeginPlay()
{

	LastFireTime = FPlatformTime::Seconds();

}

void UTankAimingComponent::TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction)
{

	if ((FPlatformTime::Seconds() - LastFireTime) < ReloadTimeInSeconds)
	{
		UE_LOG(LogTemp, Warning, TEXT("reloading"))
			FiringState = EFiringState::Reloading;
	}
	else if (IsBarrelMoving()) {
		UE_LOG(LogTemp, Warning, TEXT("aiming"))
			FiringState = EFiringState::Aiming;
	}
	else {
		UE_LOG(LogTemp, Warning, TEXT("Locked"))
			FiringState = EFiringState::Locked;
	}
}

I have tried with just a log in the tick function and this doesn’t produce any output either.

I meant physically delete the component from the actor and re-add it. That worked for me.

Good work Carson!

That did it for me too

Thanks Carson!!!

Amazing! Thanks a lot, I had the same issue and your solution worked. (On 4.14.1)

That fixed it for me as well, it also brought attention to two other bugs in the blueprint.

Privacy & Terms