Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | HollowStreak |
position += velocity * delta
position.x = clamp(position.x, 0, screen_size.x)
position.y = clamp(position.y, 0, screen_size.y)
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | HollowStreak |
position += velocity * delta
position.x = clamp(position.x, 0, screen_size.x)
position.y = clamp(position.y, 0, screen_size.y)
Reply From: | kidscancode |
Context is important - you need to also share where you wrote this code.
It is likely this error is because you put this code outside of a function. It looks like the code from the official tutorial - if this is the case, this code should be indented so that it’s inside the _process()
function just like the code above it.
thank you so much! this fixed my code!
pinklemonad3 | 2022-04-13 23:20