Again, it is not easy for us to answer this question without seen all the code(I don’t know what is on line x). But error is caused by (probably) self.book_id is “nil” which you can’t set it is position.x. It is better to use pprint() and print() to figure out the problem. If it is nil before you are setting its position then you are doing something wrong by setting self.book_id = nil on somewhere.