# "Get Mouse Position on Viewport" on Android

**URL:** <https://forums.unrealengine.com/t/get-mouse-position-on-viewport-on-android/240827>\
**Category:** Mobile\
**Tags:** unreal-engine, Android\
**Created:** [July 15, 2021, 10:56pm UTC](https://forums.unrealengine.com/t/get-mouse-position-on-viewport-on-android/240827 "2021-07-15T22:56:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Analysierer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Analysierer](https://forums.unrealengine.com/u/Analysierer)\
**Post date:** [July 15, 2021, 10:56pm UTC](https://forums.unrealengine.com/t/get-mouse-position-on-viewport-on-android/240827/1 "2021-07-15T22:56:03Z")

</div>

In my project I use “Get Mouse Position on Viewport” to place items in my level.

How can I manage in android that a mouse pointer is always displayed (without which a mouse is connected), with show maus curser it does not work.

I want to move the curser like anydek, for example.

---

<div class="post-metadata">

**Author:** ![LOL\_SixSixSix](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LOL\_SixSixSix](https://forums.unrealengine.com/u/LOL_SixSixSix)\
**Post date:** [December 13, 2021, 5:39pm UTC](https://forums.unrealengine.com/t/get-mouse-position-on-viewport-on-android/240827/2 "2021-12-13T17:39:01Z")

</div>

Hi,I have encountered this problem too, have you made any new progress? I am running on the UE’s emulator ES3.1 and everything is normal, and I can get the screen coordinates, but in the physical machine, the obtained coordinates are always (0,0)

---

<div class="post-metadata">

**Author:** ![EpiKnightz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EpiKnightz](https://forums.unrealengine.com/u/EpiKnightz)\
**Post date:** [August 15, 2025, 9:45am UTC](https://forums.unrealengine.com/t/get-mouse-position-on-viewport-on-android/240827/3 "2025-08-15T09:45:02Z")

</div>

Reviving this because I found a solution:

Get Mouse Position on Viewport try to get Cursor position, which is not where touch is on Android:

```auto
UE::Slate::FDeprecateVector2DResult FSlateUser::GetCursorPosition() const
{
	return GetPointerPosition(FSlateApplication::CursorPointerIndex);
}

```

To get the correct touch position, you need to use FSlateUser::GetPointerPosition instead and pass the correct TouchIndex as parameter. So I made a similar function to GetMousePositionOnViewport like this, for Mobile (for most cases, the TouchIndex will be 0, unless you want something multi-touches):

```auto
FVector2D UWidgetLayoutLibrary::GetTouchPositionOnViewport(UObject* WorldContextObject, int32 TouchIndex)
{
	if (FSlateApplication::IsInitialized())
	{
		FVector2D MousePosition = FSlateApplication::Get().GetCursorUser()->GetPointerPosition(TouchIndex);
		FGeometry ViewportGeometry = GetViewportWidgetGeometry(WorldContextObject);
		return ViewportGeometry.AbsoluteToLocal(MousePosition);
	}

	return FVector2D(0, 0);
}

```
