"Your First Game" Exporting Tutorial Mouse Movement Not Working

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By FlamingThunder

So I was following the Exporting section in the Step by Step Getting Started tutorial which is connected to the ‘Your First Game’ tutorial. After following the Your First game tutorial successfully the exporting tutorial starts off by changing the way the player moves from the arrow keys to mouse (and touch) movement system.

Now although the old movement system worked fine for me, after following the code in the exporting tutorial I couldn’t get the player to move with the mouse. So now the game still runs perfectly except that the player cannot move at all. I am pretty sure I followed the code exactly as I double checked. I also tried copy pasting the code (I did fix the indentation), but again the player cannot move. I don’t think I got any important error messages.

This should be the project files before changing to mouse movement

:bust_in_silhouette: Reply From: kidscancode

Did you turn on “Emulate Touch from Mouse” in the project settings?

That worked! Did I misunderstand the tutorial or was that step left out, because although the tutorial talks about emulating touch from mouse and vice versa it doesn’t actually say that we have to enable it? Also does that mean that this code is ‘designed’ for touch and that option emulates mouse clicks as touches? Thanks!

FlamingThunder | 2019-05-19 18:57

I just went and looked, and yes, I can see that might be confusing. In 3.0 the Project Settings was a little bit different. It looks like the screenshot was updated but the text wasn’t, so it doesn’t quite match anymore.

Yes, enabling that setting, makes mouse click events generate InputEventScreenTouch events. It’s perfect for cross-platform developing, and for testing your game on desktop.

kidscancode | 2019-05-19 19:03