My custom tick function in component doesn't work.

I think you have to handle both bRegister == true and false cases in RegisterComponentTickFunctions. When I added custom tick functions, my RegisterComponentTickFunctions looked basically like this:


if (bRegister)
		{
			if (SetupActorComponentTickFunction(&AutoJumpObstaclesTickFunction))
			{
				AutoJumpObstaclesTickFunction.Target = this;
			}
		}
		else
		{
			if (AutoJumpObstaclesTickFunction.IsTickFunctionRegistered())
			{
				AutoJumpObstaclesTickFunction.UnRegisterTickFunction();
			}
		}

And the only other difference I see at the moment is that I check the TickType in ExecuteTick before I do anything else with Target. So maybe Target isn’t valid yet in your case or something:



if ((TickType == LEVELTICK_All) && Target && !Target->IsPendingKillOrUnreachable())
	{
		FScopeCycleCounterUObject ComponentScope(Target);
		FScopeCycleCounterUObject AdditionalScope(Target->AdditionalStatObject());
		Target->AutoJumpObstaclesTick(DeltaTime, *this);
	}