How can I get the FHitResult from AddLocalOffset with sweep without moving the component?

When addlocaloffset it’s used, the component is moved and fhitresult tells the distance that is moved. How can I get this distance without having to move it back to its original position? Would be the same for rotation?

Hello! You can take a look on code like that, pay attention to ComponentSweepMulti method of UWorld class:

			UWorld* const MyWorld = GetWorld();

			static const FName TraceTagName = TEXT("MoveComponent");
			const bool bForceGatherOverlaps = !ShouldCheckOverlapFlagToQueueOverlaps(*this);
			FComponentQueryParams Params(SCENE_QUERY_STAT(MoveComponent), Actor);
			FCollisionResponseParams ResponseParam;
			InitSweepCollisionParams(Params, ResponseParam);
			Params.bIgnoreTouches |= !(GetGenerateOverlapEvents() || bForceGatherOverlaps);
			Params.TraceTag = TraceTagName;
			bool const bHadBlockingHit = MyWorld->ComponentSweepMulti(Hits, this, TraceStart, TraceEnd, InitialRotationQuat, Params);

Could you explain the “Params” parameter? Also, “ShouldCheckOverlapFlagToQueueOverlaps”, “InitSweepCollisionParams”, “GetGenerateOverlapEvents” appear as undefined even if i include primitives, any idea what could be?

It is special metadata object to provide additional things to query. With it you can config what actors to ignore, count overlaps or not, use complex collisions or not and so on