Actually it worked well, but in specific time, this kind of error comes and Unreal crashes when I press start button.
void UTriggerComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
AActor* Actor = GetAcceptableActor();
if(Actor != nullptr)
{
UPrimitiveComponent* Component = Cast<UPrimitiveComponent>(Actor->GetRootComponent());
if (Component != nullptr)
{
Component->SetSimulatePhysics(false);
}
Actor->AttachToComponent(this, FAttachmentTransformRules::KeepWorldTransform);
Mover->SetShouldMove(true);
}
else
{
Mover->SetShouldMove(false);
}
}
I found when I disabled Mover->SetShouldMove(true) and (false) in TriggerComponent, it worked without crashing.
I watched those lectures multible times and I can’t find what is wrong with my code. Please help me.