Download

Does ConvertMouseLocationToWorldSpace work on touch?

If not , how can i get the world space location of a touch to trace for an object(i need to ignore some other object that is in it’s front, so i probably can not use Get HitResultUnderFingerByChannel)?

Hello!
I use the following functions to get world location and direction:

float ScreenX, ScreenY;
FVector TouchLocation, TouchDirection;

GetWorld()->GetFirstPlayerController()->GetInputTouchState(ETouchIndex::Touch1, ScreenX, ScreenY, bPressing);
GetWorld()->GetFirstPlayerController()->DeprojectScreenPositionToWorld(ScreenX, ScreenY, TouchLocation, TouchDirection);

You can get world location as “TouchLocation”, and direction as “TouchDirection”.