I have an error with lerp
Asked Answered
L

5

0


I have An error please help me

Lollar answered 4/12, 2023 at 15:58 Comment(0)
E
0

Lollar First two arguments must be of the same type because function needs to interpolate between them, so make them both either float or int.

Evince answered 4/12, 2023 at 16:41 Comment(0)
E
0

@"mahesh_07"#p129283 Use a float literals. Every literal that has a decimal point is considered a float value. Otherwise it's considered an integer.

1.0 - float
1 - int

If you use variables you can explicitly cast them via float() and int()

Evince answered 4/12, 2023 at 17:14 Comment(0)
E
1

@"mahesh_07"#p129286

stylebox.bg_color.h = lerp(.0, .3, value/100.0) 
Evince answered 4/12, 2023 at 17:48 Comment(0)
L
0

Evince thank you

Lollar answered 4/12, 2023 at 18:2 Comment(0)
E
0

Lollar Btw you should get familiar with what the term literal means in the context of computer programming. It's one of the most fundamental things in every computer language.

Evince answered 4/12, 2023 at 18:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.