Material Box

Material Box

WEB Design & Material Images

Godot - Flipping sprite horizontally

Godot

This demonstrates how to flip a sprite horizontally in Godot 4 using GDScript.


The flip_h property can be used to flip a sprite node horizontally.

flip_h has the following characteristics:
- Targets the node you want to flip
- Set to true to flip horizontally
- Set to false to revert flip

var sprite = get_node('Sprite2D')
sprite.flip_h = true

Set flip_h to false to revert horizontal flipping.

var sprite = get_node('Sprite2D')
sprite.flip_h = false

Godot

TitleGodot - Flipping sprite horizontally

CategoryGodot

Created

Update

AuthorYousuke.U