0 votes

I am wondering how I can do non-parallaxing, non-camera based repeating/tiling scrolling of a Sprite and/or TextureFrame. I have a 256x256 background that is part of a cutscene that I need to use AnimationPlayer to scroll and repeat. Is this something Godot can do?

I see numerous tutorials on how to do a parallaxing background, but non on how to animate a repeating background. Any help is appreciated. Thanks!

in Engine by (88 points)
recategorized by

Not sure if understand the desired effect, like animating the texture rect of a sprite with texture with repeat enabled?

Yes! Your question gave me the answer. Here is the attribute I needed to animate:
Screenshot of the *Region Rect* attribute

Ok, I'll post as an answer

1 Answer

+1 vote

Is possible to scroll a (repeated) texture on a sprite by moving the region rect property.
Than be done by code or even with AnimationPlayer, in the case of a Polygon2D it need to move the UV (and have one first).

Something to take into account are the ending values on the motion if a loop is used, these will need to be proportional to the size so the loop gets unnoticeable .


There are other ways too, like using shaders, here is an example using the shader graph:
http://codetuto.com/2016/07/godot-engine-shadergraph-introduction-scrolling-texture/

by (7,866 points)

Thanks for adding to this post!

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.