Event tick not firing in C++ top down

by default the event tick does not fire in C++ Top Down mode in the top down character blueprints. They did work in Blueprint Top Down and C++ Third Person that I checked.

After commenting out the virtual void Tick(float DeltaSeconds) override; and its associated function in _Character.cpp the character blueprint Event Tick began working.

void AEternalThreadCharacter::Tick(float DeltaSeconds)
{
	if (CursorToWorld != nullptr)
	{
		if (UHeadMountedDisplayFunctionLibrary::IsHeadMountedDisplayEnabled())
		{
			if (UWorld* World = GetWorld())
			{
				FHitResult HitResult;
				FCollisionQueryParams Params;
				FVector StartLocation = TopDownCameraComponent->GetComponentLocation();
				FVector EndLocation = TopDownCameraComponent->GetComponentRotation().Vector() * 2000.0f;
				Params.AddIgnoredActor(this);
				World->LineTraceSingleByChannel(HitResult, StartLocation, EndLocation, ECC_Visibility, Params);
				FQuat SurfaceRotation = HitResult.ImpactNormal.ToOrientationRotator().Quaternion();
				CursorToWorld->SetWorldLocationAndRotation(HitResult.Location, SurfaceRotation);
			}
		}
		else if (APlayerController* PC = Cast<APlayerController>(GetController()))
		{
			FHitResult TraceHitResult;
			PC->GetHitResultUnderCursor(ECC_Visibility, true, TraceHitResult);
			FVector CursorFV = TraceHitResult.ImpactNormal;
			FRotator CursorR = CursorFV.Rotation();
			CursorToWorld->SetWorldLocation(TraceHitResult.Location);
			CursorToWorld->SetWorldRotation(CursorR);
		}
	}
}

I’d like to actually fix the problem, not just cover it up, does anyone have any ideas why this code would be preventing the blueprint Event Tick from functioning?

Is Tick( ) itself not being called or is it that the code in your Tick function isn’t behaving the way you think it should?

Thanks

Well, I realized that the reason it wasn’t ticking was that it was using the tick function for the mouse tracking. How would I build a function that allowed something like Event Tick to function in addition to that?

I am away from desktop at the moment, so I can’t place any cout flags or anything to troubleshoot it, but as far as the blueprint flow is concerned, the Event Tick never activates, its value is always 0.0, and it won’t trigger events unless those 2 blocks of code from initial post are commented out. Commenting those 2 blocks out, thought, gets rid of my green mouse marker. I tried it on a brand new C++ Top Down project and got the same result trying to use Event Tick in the default character blueprint.

I haven’t made any changes from the default C++ code on this project, what I posted is what the project was created with. With the exception of trying with those functions commented out.

Hey ,

Thanks for the feedback. This must of been an oversight for the team who put together the TopDown project. I have introduced a issue ticket for it. You can follow it here:

https://issues.unrealengine.com/issue/UE-37914

You can also fix the issue yourself by add the following to the bottom of the Tick( ) function in the [YourTopDownName]Character.cpp file:

Super::Tick( DeltaSeconds );