The controls work fine but the tilt starting position is when the phone is vertically parallel to the wall. I have tried printing out the desired value of the tilt when my phone is a bit angled and then adding or subtracting that value to/from the tilt but it does not work. Tried it with “tilt” and “get input motion state” nodes but the result is the same. It just adds more value to the tilt so my character is always moving upwards or downwards depending on addition or subtraction.
Is there a way to adjust the tilt value normally so that I can play the game fine when my phone sits comfortably in my hand.
See how I have rotated the phones starting position at a slight angle ( Like I am holding it in my hand), well I need that. Because the blueprint from my picture works fine and controls are good but I need to hold my phone straight vertically, like shown in your picture, for it to work.
I have tried multiple values from -1.5 all the way to 1.5 and the result is the same.
I even tried now connecting axis value from tilt to world direction but it does not solve the issue (just typing in case that was you next idea).
World Direction determines your character’s moving direction.
I’m not sure how your character moves, but in a ThirdPersonCharacter project World Direction (0,0,-1) can not make a character move. World Direction (1,0,0) + Scale value 1 → character moving forward
I also suggest that you should use Print Text to figure out what each axis does. Here’s the result of my phone:
Yup I already figured that out. Scale value 1 plus world direction (0,0,-1) moves my character up and down. Minus is just there to invert the movement but it works the same. I still didn’t figure out the starting tilt position. The game is not playable this way. In my mind what if someone wants to lay down on the bed and play the game. They would need to sit upright to play it because the phone starting tilt position is still vertical.
I’m probably boring you with the same question but I hope someone will still help me.
I believe I figured out the solution. Do not use Tilt node like I did here. Go to project settings/input and create axis mapping with your required motion movement. Then use it as a simple inputAxis event. Test out which one works for you (gravity, tilt, rotation or acceleration), you might be surprised when you see the final result because I had a totally different view in my mind when I read the motion values “gravity, tilt, rotation or acceleration”. If you are using it like this you will be able to offset the initial position of your phone.
Note:
I believe I actually made it work with “Tilt” node like shown in the picture but only with X and Y axis. I think it has something with the phones rotation settings. My game is played with one hand vertically, but if I flipped it to a two hand hold horizontally then the Z axis might work and some other axis wont. I do not know I am just giving out ideas for future developers.
Another Note:
I ended up not using the phones gyro because the controls were too janky. Now I am using a simple touch input. So this is for all new future developers. If your game’s core mechanic is this type of movement try that FIRST and test it out on your phone, no matter how time consuming it is to set up the Unreal project for android use. Keep in mind that android and iphone have different types of values for gyro so you will need to test that out separately (I think so, at least that was the case before I’ve read)
I went on a little rant here but I hope this helps at least one lost soul in the future, and if anyone figures out how to adjust the controls so that they are not that janky, share it with us. It will be much appreciated.