Godot Top-Down Movement Tutorial: Overworld Party Movement

A JRPG isn’t just battles: it’s the world you wander between them, and that means walking your party across a map, bumping into trees, and having your companions trail behind you in a line. In this Godot top-down movement tutorial, you’ll build exactly that, a JRPG-style overworld where a keyboard-controlled leader explores a tilemap and party members follow smoothly. You’ll follow the same project-first approach that has helped Zenva’s community of over 1,000,000 learners and developers gain digital skills through courses, apps, and tutorials, adding each piece of the movement system one step at a time.

This tutorial assumes you have Godot installed, are comfortable with the Inspector and the Input Map, and already have a tilemap-based overworld scene, since the battler walks around a map that already exists.

Download Project Files

The tileset, character sprites, and full project files are available through the course included in the Intermediate Godot Mini-Degree if you’d like to follow along with the completed project.

Make a Complete Card Battler in Godot e1788415191322 - Godot Top-Down Movement Tutorial: Overworld Party Movement
FREE GODOT COURSE
LEARN GODOT, UNITY, UNREAL & MORE
ACCESS FOR FREE
AVAILABLE FOR A LIMITED TIME ONLY

What a Godot Top-Down Movement System Needs

Top-down movement in a JRPG overworld has four ingredients: a controllable character, obstacles the character can’t walk through, party members that follow the leader, and a way for party members to pass through each other while still colliding with the scenery. You’ll build them in that order, starting with an overworld battler that moves with the WASD keys. Unlike the battlers in the battle scene, this character only needs a visual representation, a collision shape, and a simple movement script at this stage.

Create the Overworld Battler

Open the overworld scene and add a CharacterBody2D node. Rename it OverworldBattler and position it on the map. CharacterBody2D provides the velocity and movement methods you will use to move the character through Godot’s physics system.

Add a Sprite2D child and rename it Sprite. Use the sprite’s Texture property to load one of the overworld character images, such as the knight.

If the character is hidden behind the tilemap, expand Ordering in the sprite’s Inspector and set Z Index to 1. This places the sprite above the map’s default drawing order so you can see it.

Godot Sprite Inspector with Ordering expanded and Z Index set to 1.

Add and Align the Collision Shape

Add a CollisionShape2D child to OverworldBattler. In its Shape property, create a CapsuleShape2D, then resize it to roughly fit the character’s body. If the collision outline is obscured by the map in the editor, you can also set the collision shape node’s Z Index to 1 to make it easier to see while editing.

Adjust the Sprite child so the character’s feet sit at the OverworldBattler node’s origin. Move and resize CollisionShape2D to keep it aligned with the body. The child nodes are offset relative to the battler, rather than changing the battler’s position on the map to compensate.

A capsule collision outline fitted around the overworld knight, with the character's feet aligned to the node origin.

Set Up the Camera View

Use Run Current Scene to test the overworld. The project’s normal Run command may still open the battle scene because that is the project’s configured main scene.

The initial overworld view is not centered or zoomed as you want. Select OverworldBattler and add a Camera2D child. Center its local position on the battler. In the camera’s Inspector, set both components of Zoom to 4 for a closer, four-times view. Run the current scene again to check the framing. As a child of the battler, the camera moves with its parent without needing a separate camera script.

Configure Movement Actions

Open Project > Project Settings > Input Map. Create an action for each movement direction, then use each action’s Add Event button to assign its key:

  • move_up: W
  • move_down: S
  • move_left: A
  • move_right: D

These action names must match the strings you use in the script. You can optionally add the arrow keys as additional events for the same actions, but WASD is enough for this tutorial.

Godot Input Map with move_up assigned to W, move_down to S, move_left to A, and move_right to D.

Create and Attach the Movement Script

Inside the project’s Scripts folder, create an Overworld folder to organize your overworld-specific scripts. Create overworld_battler.gd there and declare its class and base type:

class_name OverworldBattler
extends CharacterBody2D

The script must extend CharacterBody2D because that is the type of node you are controlling. Select the OverworldBattler node and attach the script by dragging it into the node’s script property.

Add a movement speed of 30 pixels per second. Exporting this value makes it available in the Inspector so you can tune the speed:

@export var move_speed : float = 30.0

Read Input During Physics Processing

Put the movement code in _physics_process(), which runs at a fixed physics rate, rather than _process(), which runs once per rendered frame. The delta parameter represents the time between physics updates and is typed as a float.

Instead of checking each key separately and building a direction yourself, you can use Input.get_vector():

var move_dir : Vector2 = Input.get_vector("move_left", "move_right", "move_up", "move_down")

The four arguments are ordered as negative X, positive X, negative Y, positive Y. In Godot’s 2D coordinates, these correspond to left, right, up, and down. The result is a Vector2 representing the movement input.

Apply Velocity and Move the Battler

CharacterBody2D has a built-in velocity property. Multiply the input direction by move_speed to set how fast the battler should travel, then call move_and_slide() to actually move it through the physics system:

velocity = move_dir * move_speed
move_and_slide()

Setting velocity alone does not move the node. The call to move_and_slide() uses that velocity to perform the movement. The velocity is not multiplied by delta, because the method handles the physics timestep internally.

The movement script now contains the following code:

class_name OverworldBattler
extends CharacterBody2D

@export var move_speed : float = 30.0

func _physics_process(delta : float):
    var move_dir : Vector2 = Input.get_vector("move_left", "move_right", "move_up", "move_down")
    velocity = move_dir * move_speed
    move_and_slide()

Select OverworldBattler and change its Motion Mode from Grounded to Floating in the Inspector. Grounded mode is designed for characters that interact with floors and slopes, such as platformer characters. Floating mode suits this top-down movement.

OverworldBattler Inspector with Move Speed set to 30 and Motion Mode set to Floating.

Test Movement in the Overworld

Save the changes and run the current scene. Use W, A, S, and D to move the battler around the map. You can adjust move_speed if the movement feels too fast or too slow.

The knight in the running overworld scene, surrounded by grass, paths, and trees.

The character can now move, but it can still pass through trees. Giving the battler a collision shape is only one part of collision setup: the map’s obstacles also need collision data. That comes next.

Add a Physics Layer to the TileSet

The overworld currently allows the player to walk through trees, windmills, and other scenery. You can fix that by adding collision shapes to the tiles in the TileSet so these objects become obstacles. Start with trees, refine their collision polygons, and then apply the same process to buildings.

In the FileSystem dock, open Sprites > Overworld and double-click overworld_tileset.tres. Drag the top edge of the TileSet dock upward to give the tile atlas more space.

The TileSet resource contains your tiles and the data associated with them. Its Inspector includes Physics Layers, Navigation Layers, and Custom Data Layers. To enable collision data for the tiles, expand Physics Layers and click Add Element.

The TileSet Inspector with Physics Layers expanded and a physics layer added.

Paint the Initial Tree Colliders

Switch to the Paint tab in the TileSet dock. Under Paint Properties, select Physics Layer 0. You can now click tiles in the atlas to apply a collision shape.

Find the tree made from multiple tiles. Click its lower tiles and then its upper tiles to apply the default square shape. Blue overlays indicate the collision areas assigned to those tiles.

Physics Layer 0 selected in the TileSet Paint tab, with blue square colliders on the tree tiles.

Save the changes and press Play. The player should now stop when moving into the tree instead of passing through it. However, the full-tile squares extend beyond the shape you want, so the player stops too far away in some places. Next, you’ll refine those shapes.

Reshape and Mirror the Tree Polygons

Return to the TileSet and begin with the tree’s bottom-right tile. The small polygon editor beneath Paint Properties lets you drag the white vertex handles to change the collision shape. Move the points to fit the tree, bringing the lower boundary upward to leave some room for the player’s head.

After editing the shape, click the corresponding tile in the atlas again to apply the new polygon. Changing the shape in the small editor prepares it for painting; you still need to apply it to the tile.

The collision polygon editor with points adjusted to fit one side of the tree.

For the matching tile on the opposite side, open the polygon editor’s three-dot menu and choose Flip Horizontally. Click the opposite tile to apply the mirrored shape.

The tree’s upper tiles only need small collision regions near their bottom corners. Drag the polygon points into the appropriate corner, apply the shape, and then flip it horizontally for the matching upper tile. Together, these polygons create a much smaller collision area than the original full squares.

The tree atlas with smaller collision polygons placed near the center of the tree.

Save and play again. Move into the tree and around its edges to check that the player stops at a more suitable distance.

Reset the Shape for Another Tree

When you move to the smaller tree, the painting tool still uses the last polygon you edited. Open the three-dot menu and select Reset to default tile shape to start from a full square again.

The polygon tools menu with Reset to default tile shape and Flip Horizontally commands.

Move the lower points upward to about halfway through the tile, leaving room for the player’s head. Bring the side points inward to approximate the upper section of the tree. The polygon does not need to follow every pixel exactly.

Click the tree tile to apply the finished polygon, then play the scene and try walking into it to confirm that the collision works.

A polygon fitted around the upper portion of the small tree, leaving room below it for the player's head.

Add Collision Shapes to the Castle

You can use the same tools for buildings. Start with the castle, reset the polygon to the default shape, and move its lower boundary upward before painting the lower tiles.

Adjust the polygons for the sections above so they fit the building’s outline. Use Flip Horizontally to reuse a shape on the opposite side. For the pointed top, make a small triangular shape and mirror it for its matching tile.

If a shape needs another vertex, click the middle of one of its edges and drag to add a new point. This gives you another handle for refining the outline. Apply each adjusted polygon to its intended tile.

Blue collision polygons fitted to the castle's lower sections and pointed top.

Complete and Test the Remaining Obstacles

As practice, repeat this process for the remaining buildings and trees, including the other fortress. Reset the painting shape when necessary, fit the polygons to each object, and reuse mirrored shapes where appropriate.

Save and run the scene. Walk into the different objects on the details layer to verify that the player collides with them. The completed map should prevent movement through the scenery you have given collision shapes.

The player beside a building during a play test of the completed overworld collisions.

Environmental collisions are now in place. The next step is setting up followers so the party members appear in the overworld and move behind one another in a line.

Define the Leader and Follower Properties

To represent the whole party in the overworld, one battler will act as the party leader, controlled with the keyboard, while the remaining battlers form a follower chain. Open overworld_battler.gd and add these exported variables:

@export var is_party_leader : bool
@export var follower : OverworldBattler
@export var follow_distance : float = 15.0
  • is_party_leader determines whether this battler reads keyboard input.
  • follower references the battler behind this one, not the battler it follows.
  • follow_distance sets the distance at which a follower stops approaching its target. The default is 15.0 pixels so the battlers do not all try to occupy the same position.

Each battler can have its own follower. The leader tells the next battler to follow it, that battler tells the next one to follow, and so on. This lets you extend the party without giving every follower a direct reference to the leader.

Separate Keyboard Movement From Follower Movement

Only the party leader should use the existing input code. In _physics_process(), place the input and velocity assignment inside an if is_party_leader: condition. Leave move_and_slide() outside this condition because every battler still needs to move.

Next, create a function that will move a follower toward a specified battler. You can begin with an empty implementation:

func move_towards_battler (battler : OverworldBattler):
	pass

Back in _physics_process(), check whether a follower has been assigned. If it has, call that follower’s new function and pass self as the target:

func _physics_process (delta : float):
	if is_party_leader:
		var move_dir : Vector2 = Input.get_vector("move_left", "move_right", "move_up", "move_down")
		velocity = move_dir * move_speed

	if follower != null:
		follower.move_towards_battler(self)

	move_and_slide()

The null check allows the final battler in the chain to have no follower. The function call assigns movement to the battler behind the leader, while that battler’s own move_and_slide() applies its velocity.

Move Toward a Battler and Stop at the Follow Distance

Replace pass in move_towards_battler() with the first version of the movement logic. You need both the distance to the target and the direction toward it:

func move_towards_battler (battler : OverworldBattler):
	var dist : float = global_position.distance_to(battler.global_position)
	var dir : Vector2 = global_position.direction_to(battler.global_position)

	if dist > follow_distance:
		velocity = dir * move_speed
	else:
		velocity = Vector2.ZERO

distance_to() returns how far apart the two global positions are. direction_to() gives you a direction vector pointing toward the target, which is multiplied by the existing move_speed to calculate velocity.

When the distance exceeds follow_distance, the follower moves toward the target. Otherwise, velocity is set to Vector2.ZERO. This reset is essential: without it, the follower would retain its previous velocity and continue moving even after reaching the desired distance.

Assign a Follower in the Inspector

Return to the overworld scene, select the battler, and duplicate it with Ctrl+D. Move the duplicate to one side so you can distinguish the two characters.

Select the battler you want to control and enable Is Party Leader in the Inspector. Leave this option disabled on the other battler. Drag the follower node from the Scene tree into the leader’s Follower property, keeping Follow Distance at 15.0.

Godot Inspector showing Is Party Leader enabled, the Follower assignment field, Follow Distance set to 15.0, and Move Speed set to 30.0.

Run the scene. The follower should approach the leader and follow as you move around. At this stage, movement switches instantly between full speed and a complete stop. Near the distance threshold, especially when moving in a circle, this can make the follower appear jittery.

Smooth Acceleration and Deceleration

To soften these abrupt changes, introduce a target velocity instead of assigning the actual velocity immediately. At the start of each call, set target_vel to Vector2.ZERO. If the follower is too far away, replace it with the movement direction multiplied by speed.

You can then remove the previous else block and interpolate the current velocity toward the target:

func move_towards_battler (battler : OverworldBattler):
	var dist : float = global_position.distance_to(battler.global_position)
	var dir : Vector2 = global_position.direction_to(battler.global_position)
	var target_vel : Vector2 = Vector2.ZERO

	if dist > follow_distance:
		target_vel = dir * move_speed

	velocity = velocity.lerp(target_vel, 0.3)

lerp() performs linear interpolation. With a weight of 0.3, each call moves the current velocity partway toward target_vel, creating a gradual acceleration or slowdown. Increasing the weight toward 1.0 makes the change quicker and the movement more immediate.

When the follower is within the follow distance, the target velocity remains zero, so the follower slows down instead of stopping instantly. Run the scene again and test starting, stopping, and changing direction. The movement should be smoother, although a little jitter may remain.

Two knight battlers following one another through the grassy overworld near a path and houses.

Save the Battler as a Reusable Scene

During testing, you can also notice that the follower blocks the leader when you try to move backward through it. That’s fixed in the next section, but first, make the battler setup reusable.

Drag the first OverworldBattler node into the Scenes/Overworld folder to save it as overworld_battler.tscn. Remove the other duplicated battler and drag the saved scene into the overworld to create a new instance.

Disable Is Party Leader on the follower instance. Then select the leader and assign the new instance to its Follower property. Both battlers should behave as before, but they now share a reusable scene that will make later changes easier.

Godot Scene tree containing two OverworldBattler instances, with overworld_battler.tscn saved under Scenes/Overworld in the FileSystem panel.

Understand Collision Layers and Masks

You want your party members to walk through one another without losing their collisions with the environment. At the moment, their colliders cause them to bump into each other. The fix is to separate battlers from environmental geometry using Godot’s collision layers and masks.

Open the Overworld Battler scene and select the OverworldBattler root node. In the Inspector, expand Collision under CollisionObject2D. Be careful to use this section, rather than the separate Collision section under CharacterBody2D.

Two settings control how the battler interacts with other colliders:

  • Layer determines which collision layer or layers the battler belongs to. An object can belong to one layer or multiple layers.
  • Mask determines which collision layers the battler detects when checking for collisions.

Separate Battlers From the Environment

In the battler’s Layer grid, enable 2 and disable 1. This places the battler on collision layer 2 instead of the default layer 1.

In the Mask grid, leave only 1 enabled. Your battlers now belong to layer 2 but detect only objects on layer 1. Since other battlers also belong to layer 2, they no longer block one another.

The OverworldBattler collision settings have layer 2 enabled and mask layer 1 enabled.

Test Movement and Environmental Collisions

Save the scene and run the overworld scene. Move the party around and through the other party member. The battlers should be able to overlap and walk through one another, while still being stopped by environmental colliders.

Two party members overlap beside a tree while the overworld scene is running.

To understand why the environment still blocks movement, select the overworld_tileset.tres resource and expand Physics Layers in the Inspector. Its Collision Layer and Collision Mask both have layer 1 enabled.

The important connection is between the battler’s mask and the environment’s layer: the battler detects layer 1, and the TileSet’s environmental colliders belong to layer 1. Moving the battler itself to layer 2 does not prevent it from detecting that geometry.

The overworld TileSet has collision layer 1 and collision mask layer 1 enabled under Physics Layers.

Conclusion

Your party can now explore the overworld together, single file and free of collisions with each other. Along the way, you covered:

  • Creating an overworld battler with CharacterBody2D, a sprite, and a capsule collider
  • Setting up WASD input actions and a follow camera
  • Reading input in _physics_process() and applying velocity with move_and_slide()
  • Adding a physics layer to a TileSet and painting collision shapes on tiles
  • Refining, mirroring, and resetting collision polygons
  • Building a leader-and-follower chain with follow distances
  • Smoothing follower movement with velocity interpolation
  • Separating battlers from the environment with collision layers and masks

From here, the natural next step is entering battles from the overworld, which will call for persistent data and battle presets that define each encounter’s enemies and background.

If you want to keep building this JRPG with a structured, project-based path, the Intermediate Godot Mini-Degree continues this project through the overworld system and other intermediate Godot topics.

Did you come across any errors in this tutorial? Please let us know by completing this form and we’ll look into it!

FREE COURSES
Python Blog Image - Godot Top-Down Movement Tutorial: Overworld Party Movement

FINAL DAYS: Unlock coding courses in Unity, Godot, Unreal, Python and more.