Ive come across an error which i have tried tackling for a while now.
if outerball.pos.x >= (self.r - 0.1):
if self.rotations == 0:
stopt = time.time ( )
onerot = stopt - startt
print(onerot)
self.rotations += 1
# update variable outputs
timey.text = "time: %1.f" % onerot + " seconds"
error is timey.text = "time: %1.f" % onerot + " seconds"
UnboundLocalError: local variable 'onerot' referenced before assignment
Ive tried globalizing the variable but it still hasnt made a difference. Can someone pls explain how i can fix this.
Thanks