pkdawson / imgui-godot

Dear ImGui plugin for Godot 4
MIT License
466 stars 27 forks source link

cannot change values wuth ImGui #88

Open sinaSPOGames opened 4 days ago

sinaSPOGames commented 4 days ago

i use this following code to change some values that will be important for me to debug on

var player = null
func _DEBUG_UI(delta):
    if player != null:
        ImGui.Begin("DEBUG_GUI")
        ImGui.DragFloat("Vehicle Dirtyness", [player.dirtyness])
        ImGui.DragFloat("Vehicle Engine Health", [player_health_engine])
        ImGui.DragFloat("Vehicle Body Health", [player_health])
        ImGui.End()

the problem is none of these values do change no matter what i do, those values arent controlled by anything else unless there is some circumstances for example engine health reduces only if my player's vehicle goes over its RPM capacity (an V8 going over 10krpm)

no matter what i do those values never change

pkdawson commented 4 days ago

See https://github.com/pkdawson/imgui-godot/issues/73#issuecomment-2214774494

I really need to reorganize and expand the docs to clarify some common issues.

sinaSPOGames commented 3 days ago

I found out my way out with this method tho

var imgui_value_number := [something]

In function:
   ImGui.dragfloat("something", imgui_value_number)
   If GameManager.Brute_Update:
      My_actual_value = imgui_value_number[0]

This is kinda something but good enough for me This can be helpful for those who can't modify their var to be array since that variable is possibly being used by alot of code making the things harder for them