0 votes


I want to achieve something similar to this animation:


What I have

My project tree looks like this:
Control > Panel > Path2D > PathFollow2D > Node2D > Sprite & (Node > Line2D)
The Panel is the green background. The Path2D together with the PathFollow2D move the Sprite along the desired route.

My idea is to draw the pattern using multiple Line2D nodes. First I tried to just use one single long line for the full path but after adding ~5100 Vector2 objects to the Line2D.Points property, the line stopped working. Some of the first few points (except the very first one) disappear and adding new points to the Line2D.Points property has no effect at all.

I also ran into the error ERROR: _draw_polygon: Condition ' buffer_ofs > data.polygon_buffer_size ' is true. a couple of times.


What other options are there to achieve something similar to this?

in Engine by (111 points)

I think you can use sprites of those 2 stripes and use shaders to make them visible when that machine moves over them.

Hi @supper_raptor, thanks for your answer. Unfortunately I have no clue about shaders.. Can you recommend any resources to get started?

Please log in or register to answer this question.

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 Frequently asked questions and 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 [email protected] with your username.