How can you ask if a number is 5, give or take 1? (they are example numbers)

I would think there a better way to do:

[lua] if math.floor(object.rotation) == targetangle+1 or math.floor(object.rotation) == targetangle-1 then [/lua]

I can’t use:
object.rotation == targetangle
because object.rotation gives values such as 55.44444444444444881

It seams stupid to use an OR statement. [import]uid: 79135 topic_id: 16097 reply_id: 316097[/import]

use a <= or >= if that will help you

you can specify a range as

if (value>=target and value
cheers,

?:slight_smile: [import]uid: 3826 topic_id: 16097 reply_id: 59874[/import]