-1

I want to create an app in unity in which I can swing my phone like a bat and it tells me in which direction of the clock I play a shot. Like when I Swing phone towards 6'o clock ...it should tell me 6 when swing phone towards 9'o clock ...it should tell me 9...etc

geekfarmer
  • 99
  • 2
  • 7

1 Answers1

0

This is not possible because phone does not know (and cannot know) its relative position to the user.

You can detect horizontal or vertical gestures easily but guessing the direction from/to user is the problem.

shelll
  • 3,234
  • 3
  • 33
  • 67
  • please see this video. Then tell me it is possible or not. I think U didn't understand my question. – geekfarmer Aug 31 '18 at 12:01
  • @optnio00 That video shows swings in one direction only - always away from the user. Looks like you must swing with the display facing the direction of the swing. So it does not matter if it is left to right, right to left, away from you, the only thing that matters is if the display faces the direction of the swing (probably also displays angle to the swings direction) - that is detectable. But you cannot detect swing's direction relative to the user with sensors inside the phone. – shelll Aug 31 '18 at 13:12
  • please carefully see the video about Kia Game on Tennis more on youtube. – geekfarmer Sep 02 '18 at 12:05