Player script

The player's script also needs to extend the character's. Remove the attached script (Character.gd) by selecting the Player node and clicking the Clear script button:

Now, click the button again to attach a new script. In the Attach Node Script dialog, click the folder icon next to the Inherits option and select Character.gd:

Here is the player script (note that it extends the character script):

extends "res://character/Character.gd"signal movedfunc _process(delta):    if can_move:        for dir in moves.keys(): if Input.is_action_pressed(dir): ...

Get Godot Engine Game Development Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.