Invalid call during scripting.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By THE HELIX

How to solve this error
" Invalid call. Nonexistent function ‘size’ in base ‘Vector2’. "
The script is

extends Node2D

var path = []
var drag_mouse = false
var circle_size = 30

func _ready():
  set_process_input(true)

func _draw():
  if (path.size()):
	 for i in range(path.size()):
		 draw_circle(path[i] - global_position, circle_size, Color(1, 1, 1))
  pass

Did you set the path somewhere else?

Dlean Jeans | 2019-06-23 06:50

No. I wanted to draw the line/path like in the image

THE HELIX | 2019-06-23 07:48