I have this piece of code, that no other part of the project touches.
Somehow godot is trying to reassign my variables to -0.5 and 0.5 respectively (values that I started with previously but apparently can’t change now, I’ve tried many combinations of values but it keeps outputing the same)
I had to use to setters to keep the base values, but used the print function to see if I was going crazy:
var min_pitch: float = -0.05: # Looking down
set(value):
min_pitch = -0.05
print("min_pitch was changed to ", value)
var max_pitch: float = 0.05: # Looking up
set(value):
max_pitch = 0.05
print("max_pitch was changed to ", value)
output: min_pitch was changed to -0.5 max_pitch was changed to 0.5
I added get_stack() and it apears to be from the setter, somehow (I even tried on a different PC). The output:
min_pitch was changed to -0.5 by [{ “source”: “res://Scripts/camera_controller.gd”, “function”: “@min_pitch_setter”, “line”: 11 }]
max_pitch was changed to 0.5 by [{ “source”: “res://Scripts/camera_controller.gd”, “function”: “@max_pitch_setter”, “line”: 15 }]
I have solved the problem by using the setters (a bad solution, I know, would be better to use the ready func). I posted it here because it makes no sense to me and I was hoping someone would illuminate me or tell me this is actually a known bug or idk XD