Choosing a direction to jump

Hello everyone,
I had a question about a feature i wanted to put in my mobile game that i am making. So the question is how do i choose a direction on my mobile device and jump to the direction i choose? I wanted to have a arrow that shows the direction and as soon as i release my finger, i wanted the player to jump.
Im grateful for any help. Thanks.

Hello, your question is difficult to answer with so little information.

In the Scripting API there is an example under Touch.phase that could help you.

If you are aiming for a 2D game, or you are working with a top down camera without rotation being involved, then it would be sufficient, for example, to use the code example of the touch phase and transfer the direction directly to the character when you release the input.

But if your game takes place in 3D space and you always want to transfer the input depending on the current perspective of the camera, you have to do something different, because the touch position in screen space pixel coordinates doesn’t help you much here.