Detect device movements

Hi.

Can someone suggest me a way to detect if the Android device is moving?

I can find a lot of post that talk about the player moving, but what I need is to detect if who is keeping the phisical device is walking an if it is changing direction.

This because I want to move the player in the game like the player in real world.

I can’t find clear explanation

Thanks

Hello, @Reicon!

If you want something like steering for a racing game, you want to use the accelerometer within the phone, which would be accessible through certain plugins, I don’t think UE5 has native integration without plugins.

If you want something akin to Pokemon GO! or Monster Hunter Now, you need to use Geo Tracking, which is supported a BIT:

But if you want fine movement detection you will need an external camera like with a lot of advanced VR setups.

Hope this helped! :slight_smile:

1 Like

I need to understand what this exactly do and search some example, but I think this is what I am searching for.

1 Like

In your opinion can I read latidude and longitude every tick and comparing with previous values calculate a vector to determine the “quantity“ of movement and its direction?

Or are there some dedicate tools in the pool you suggested?

Pretty much! That’s how the API seems to be reading. You may want to adjust the tick rate for the actor doing the reading of that so you aren’t checking lat/long 60x second, but yeah use the previous lat/long and compare it to the new lat/long, get the distance, save new lat/long as old lat/long, rinse repeat!

Sorry but I am still confused. Ok I understand the concept, but I can’t find an example.

In blueprint the node Get Geo Location at World Position return latitude and longitude, but I can’t understand what World position input is. I mean: am I obtaining the position info by providing the position info? It’s obvious that I am misunderstanding the input source

It’s comparing the Geographical location (real world) at World Position (UE level) and converting one to the other.

Try using Cesium or Unreal’s Georeferencing plugin!

Otherwise you’ll have to write something yourself, and something like that would be beyond advanced. I assume anything coded specifically would be guarded tightly or exorbitantly expensive :frowning:

Ok, Thanks. I will try