Tilt returning zeros after touching the screen (Blueprint, iPad / iOS7)

I have a Blueprint listening to tilt events. When I run the app in an iPad, everything is fine until I touch the screen. After the touch tilt returns only zeros. I haven’t got touch processing in my Blueprint, so this is very confusing. I couldn’t find documentation on tilt or gravity. Am I missing something?

Hi ,

Do you have any touch actions within your game at all? What is it set to do if so?

I had touch handler which spawned an object into the level. Spawning worked as expected, but at the same time player controller transform was reset. When I removed the handler by removing connection from touch event to the spawning script, the object was not spawned anymore, but the transform was still being reset.

I haven’t enabled touch controls in the settings, and I don’t have touch handlers anywhere else. My example is so basic that I am sure I am missing something. I am using Character as the basis for the player, does this have some functionality that I am overlooking?

Hi ,

Which template are you using for your game? Can you post a screenshot of your tilt functionality and your touch functionality? Thank you!

I have a blank project as a basis. I added controls for mouse, game pad and tilt & touch. Here is a screenshot of tilt and touch. Touch is messy, but as said, tilt stops working even if I remove the connection from touch event to the rest of the code.

Try creating a new project, in it set touch input to something like “print string”, just something to consume the input, then add a tilt input that does some function. Does this cause the same error? The reason I ask is that in your touch event you have it basically creating an actor and immediately destroying it. I am wondering if the reason the tilt isn’t working is because the actor is being destroyed too quickly to be able to function.

About destroying the object: The object triggers an event when it has landed, which causes the script to reposition the player and then destroying the object. So the script works as it should.

I created a new project, added a Blueprint based on Character, added only the tilting script to it, added a game mode which uses this pawn, and the result is: Tilt works until I touch the screen. I didn’t add any code to process touch events.

I’m not sure I understood what you meant. I added touch input event which, when triggered, prints a string to the console. Tilt works as expected until I touch the screen: the string is printed to the console, and tilt becomes mute.

Is there some default functionality in Character that reacts to touch?

ok, try putting a touch event in that leads to a branch with no other functionality. See if that consumes the touch input and allows you to access your tilt function. If this works, it would seem that the touch input is in some way overriding the tilt input, which will make it easier to reproduce.

Oh I see. I thought you had said you didn’t add any touch input. This won’t matter then. Let me try to reproduce this on my end and see if I can get it to occur.

Hi . I upgraded to 4.4.3 (previous version was 4.4.1), and now touch works as expected.

Hi ,

I am happy to hear it is working for you. I will mark this as accepted for tracking purposes. Have a great day!