Coding_Guy
Coding_Guy

Reputation: 151

How do I play a gif in godot4?

I want to play a simple gif in my godot4 project.

Let's say that I have a gif file named video.gif. How do I play it using GDscript? Which component would play a gif? If I can't play a gif, can I play a video file? If I also can't do that, how can I display a video/gif in godot4?

Upvotes: 1

Views: 4974

Answers (1)

Theraot
Theraot

Reputation: 40305

Out of the box Godot does not have support for gif. It might be possible to add this functionality via plugins, however I'm not aware of one for gif.

If you can use video, then I recommend the OGV format, which Godot supports, of course. You can play it with the VideoStreamPlayer in Godot 4, or the VideoPlayer in Godot 3. Godot 3 also had support for WEBM video, however it was problematic, which let to it being removed for Godot 4.

See Playing Videos (Godot 4, Godot 3) for details.

Upvotes: 4

Related Questions