0 votes

I finished a mouse-click path finder to a little isometric game I'm trying to make, but then I added a Camera2D and the path just get messy when the camera moves.
I'm sure it's the camera because if I delete it everything comes back to normal.

Here is the code in GDScript that generates the path

extends Node2D

onready var nav2D = $Navigation2D
onready var charact = $Character
onready var line = $Line2D

func _input(event):
    if event is InputEventMouseButton and event.button_index == BUTTON_LEFT and event.is_pressed():
        var clickPosi = event.global_position
        var charPosi = charact.global_position
        var path = nav2D.get_simple_path(charPosi, clickPosi)

        line.points = path
        charact.path = path

        charact.move()
in Engine by (12 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.