IsOverlapping return true, always!

As said on title this code return true always, i moved the trigger outside of the scene and it is triggered

if(pressurePlate->IsOverlappingActor(actorThatOpens))
{
OpenDoor();
}else
{
CloseDoor();
}

th

Can you put the code for the method IsOverlappingActor? also, I would put a log befor the if, something like this

bool aux = pressurePlate->IsOverlappingActor(actorThatOpens);
//LOG OF AUX VARIABLE
if(aux){

}else{

}

and also first of all do this:

if(false){

}

to force and see that the if behaviour it’s correct but this last I think it won’t be necessary

Using log for some reason caused the game engine to crash then it works
thanks

i keep having weird compiler errors

Can you post the method and the log line that crash?

void UOpenDoor::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);

FRotator x = GetOwner()->GetActorRotation();
UE_LOG(LogTemp, Warning, TEXT("%s"),x.ToString());

if(pressurePlate->IsOverlappingActor(actorThatOpens))
{
OpenDoor();

}else
{
CloseDoor();
}
I was using visual studio to debug c++ in the editor too btw by attaching debug mode to the active process of unreal engine

m… maybe

FRotator x = GetOwner()->GetActorRotation();

should be

FRotator x = actorThatOpens->GetActorRotation();

but I would log also the return of overlapping, because if always return true, then the error is in the method IsOverlappingActor. Could you put the code of that method please?

Privacy & Terms