Camera panning (2d) and area2D

Godot Version

How could i achieve a panning effect with area 2d nodes and a camera

Question

4.3

I want to achieve a panning effect similiar to the one found in Five Nights At Freddy’s

here’s the scripts

var isHoveringRight = false

func _process(_delta):
	if isHoveringRight == true:
		position.x =+ 10

func _on_navigate_right_body_entered(body):
	isHoveringRight = true
func _on_navigate_right_body_exited(body):
	isHoveringRight = false

what’s supposed to happen is that it supposed to continue moving the camera up until you remove your cursor from the area 2D, but it only moves once

how could i Fix this?

position.x =+ 10

This reads as “position.x equals positive 10”

you mean to flip the operators to +=

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.