Hello, to keep things short im trying to perform a trace “forward” from a static mesh component inside my blueprint, im using the following code to do so
bool ATTRoom::DoorDirectionsMatch(ATTRoom* OtherRoom)
{
FVector OurLocNorm;
FVector OtherLocNorm;
FVector Direction;
FCollisionQueryParams RV_TraceParams = FCollisionQueryParams(FName(TEXT("RV_Trace")), true, this);
RV_TraceParams.bTraceComplex = true;
RV_TraceParams.bTraceAsyncScene = true;
RV_TraceParams.bReturnPhysicalMaterial = false;
//Re-initialize hit info
FHitResult RV_Hit(ForceInit);
OurLocNorm = GetRoomDoors()->GetComponentLocation();
OtherLocNorm = OtherRoom->GetRoomDoors()->GetComponentLocation();
Direction = GetRoomDoors()->GetComponentRotation().Vector().ForwardVector;
GetWorld()->LineTraceSingle(RV_Hit, OurLocNorm, OurLocNorm + Direction * 500, ECC_WorldDynamic, RV_TraceParams);
DrawDebugLine(
GetWorld(),
OurLocNorm,
OurLocNorm + Direction * 1000, //
FColor(255, 0, 0),
false, -1, 0,
12.133
);
// other code
}
It gives me the expected result which is a trace forward from the static mesh component ( the wall doors in thsi case )
Now the issue comes up when i try to rotate the room
As you can see the trace is still being done but for some reason it doesnt follow along the rotation of the door even tho i am using the rotation for the trace… Any help is always appreciated