Hello I am working on a wire between two points. I want to set the location to one point and then find the angle between them so that the wire connects both points. This is what the code below does
void ABaseWire::ConnectPowerSource(FVector DrainerConnection, FVector SourceConnection, AItem* PowerSource, AItem* Drainer)
{
SetActorScale3D(FVector(10, 10, 100 *(FVector::Distance(DrainerConnection, SourceConnection) / 100.0)));
SetActorLocation(SourceConnection);
FRotator RotationVector = UKismetMathLibrary::FindLookAtRotation(SourceConnection, DrainerConnection);
SetActorRotation(RotationVector);
SetActorHiddenInGame(false);
}
However the rotation is always in the opposite direction, I am not sure what causes the problem but the rotation is calculated with findlookatrotation(). Thank you in advance for the help.