0 votes

I upgraded to beta and in the process of trying to get the code working but I'm stuck on this particular part.

    if event is InputEventMouseButton and event.pressed and event.button_index == BUTTON_LEFT:

I have two more if statements in the same script and all are giving me the same "Identifier "BUTTONLEFT" not declared in current scope" error. But when I look at at the docs under the "Mouse Motion" section. it gives an example where they use the same "BUTTONLEFT". I know the docs aren't stable and can include old examples/documentations in certain sections. Does anyone know what to do here?

Thanks in advance!

Godot version 4beta10
in Engine by (31 points)

This looks correct to me.

I think in Godot 4 it should be MOUSE_BUTTON_LEFT instead of BUTTON_LEFT
https://docs.godotengine.org/en/latest/classes/class_%40globalscope.html#enum-globalscope-mousebutton

You're right! Thank you.
I was loooking at this page where it uses what I assume is an old example.
https://docs.godotengine.org/en/latest/tutorials/inputs/input_examples.html

1 Answer

0 votes
Best answer

Sporx13 provided the answer:

I think in Godot 4 it should be MOUSE_BUTTON_LEFT instead of BUTTON_LEFT
https://docs.godotengine.org/en/latest/classes/class_%40globalscope.html#enum-globalscope-mousebutton

by (31 points)
edited by
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.