Weird linear fogg error.

I was trying to create linear fog so i set a variable in my planet class like

self.atmosphereRange = (0 ,32)  

But when i try to set my fog’s actual range like this:


It gave me this error : TypeError: a float is required

I have no clue why i get this error because if i replace that line of code with

    self.atmosphere.setLinearRange(0, 32)

i can see the fog

What is happening?

When you call:


you are not passing two parameters to setLinearRange. You are passing one parameter, which happens to be the tuple (0, 32). But it is still one parameter.

If you want to pass the two components of the tuple as the two parameters to the function, you can do something like this:

self.atmosphere.setLinearRange(self.atmosphereRange[0], self.atmosphereRange[1])

Or, equivalently, you can do this:



Thank you for your help.