Whenever I add a backdrop to my game, it inherits the movement, and I have zero clue why.
Heres my code for movement:
extends CharacterBody2D
@export var speed = 400
var target = position
func _input(event):
# Use is_action_pressed to only accept single taps as input instead of mouse drags.
if event.is_action_pressed(&“click”):
target = get_global_mouse_position()
Hmmm… Could you give us more info about your backdrop? Are there any scripts attached to it? What kind of node is it? This script isn’t attached to the backdrop is it?
What does the hierarchy of you nodes look like in the scene tree window? Can you post a picture? The only thing I can think of is maybe the background is a child of the CharacterBody2D?
It should look something like this picture. Everything that’s a child of characterBody2D will move with it, so if TextureRect is your backdrop, the thing you don’t want to move, then it needs to be a child of the root node and not CharacterBody2D.