The easiest way to skyrocket your YouTube subscribers
Get Free YouTube Subscribers, Views and Likes

How to Fix Sprite Teleporting - Custom Root Motion | Godot 4.2+ Tutorial

Follow
emrld

General spriting practice recommends keeping the sprite in the same place throughout the animation. Still, you cannot always follow this but, when you don't, the sprite teleports after their animation finishes. So, when you do break this rule, how do you return the sprite to its original place?

This is solved by root motion. Unity supports 3D and 2D root motion. Sadly, Godot only supports 3D, not 2D. This is a guide on creating your own simple 2D Root Motion using keyframes in the AnimationPlayer and a root as a Sprite2D.

0:00 Spriting stuff
0:17 What is Root Motion
0:47 Create root and origin
1:18 Keyframe root position
2:05 When to call the function

#godot #gamedev #tutorial #guide

posted by tastasbc