'Can't use NumericProperty in pos() of a widget

[SOLVED]

I am trying to use a NumericProperty inside the kivy lang. I can't figure out how to use it inside of a pos argument

When I run the code I get the following error: "kivy\weakproxy.pyx", line 32, in kivy.weakproxy.WeakProxy.getattr

I want to insert a value into the pos of a widget via a NumericProperty. How do I do that?

This code has been simplified main.py


class Game(Screen):
    def SomeFunction(self):
        self.value = 60
   
        X = NumericProperty(self.value)

main.kv

Game:
    FloatLayout:
        SomeWidget:
            pos_hint: {"center_y": 0.5}
            pos: (root.X, 50)

I expected the Widget to move by the amount given by X*(the NumericProperty)*, tho the aforementioned error occurred.

Any help is appreciated :)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source