Skip to content

vslider _gui_input(event: InputEvent) reports old value #47322

@wyattbiker

Description

@wyattbiker

Godot version:
Godot Engine v3.2.4.rc4.official - https://godotengine.org
OpenGL ES 3.0 Renderer: NVIDIA GeForce GT 650M OpenGL Engine
OpenGL ES Batching: ON
Mac OS X Catalina 10.15.7

Issue description:
VSlider reports old value of slider in _gui_input(event: InputEvent) signal

Steps to reproduce:

  • Open New Scene
  • Add a VSlider Control
  • Add an empty script
  • Click on VSlider control and select the Inspector Node Tab
  • Connect the gui_input) and _value_changed(() signals to the methods below.
  • modify script signal methods as below.
  • Run scene
extends VSlider

#This signal is called 1st
func _on_VSlider_gui_input(event: InputEvent) -> void:
	if (event.is_pressed() and event.button_index == BUTTON_LEFT):	
		print("\nClicked")
		print("_gui_input: ",value) # Reports the old slider value

#This signal is called 2nd
func _on_VSlider_value_changed(value: float) -> void:
	print("_value_changed: ",value) # Correctly reports the current slider value

When VSlider is clicked _gui_input() method reports the original old value, while _value_changed() reports the correct new value.

Example Output:

Clicked
_gui_input: 0
_value_changed: 6

Clicked
_gui_input: 6
_value_changed: 1

Clicked
_gui_input: 1
_value_changed: 9

Makes the _gui_input() not as useful.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions