the problem was me printing the variable in the function instead of putting it straight to love.draw
Search found 3 matches
- Thu Jul 22, 2021 4:13 pm
- Forum: Support and Development
- Topic: why cant i add dt to a variable
- Replies: 6
- Views: 9045
- Wed Jul 21, 2021 4:18 pm
- Forum: Support and Development
- Topic: why cant i add dt to a variable
- Replies: 6
- Views: 9045
Re: why cant i add dt to a variable
Where is p getting called from? Is it getting handed the 'dt' variable correctly? You could trying this to get an idea of why the error is happening: function timer(dt) print(d) -- this will give you console output showing if d is okay print(dt) -- this will give you console output showing if dt is...
- Sat Jul 17, 2021 4:42 pm
- Forum: Support and Development
- Topic: why cant i add dt to a variable
- Replies: 6
- Views: 9045
why cant i add dt to a variable
So, i am trying to make a timer but when i tried to add dt to a variable it only gave me a error that says tried to do arithmetic on local dt d = 0 function timer(dt) d = d + dt love.graphics.print(d) end the function timer(dt) is in the update function also in the draw function function p:update(d...