0 votes

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

in Engine by (23 points)

1 Answer

+1 vote
Best answer

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

by (22,067 points)
selected by

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!

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.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.