![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Nitsuga |
I have run into a problem and wanted to know if it is a Godot error or my ignorance.
func _ready():
var path = [Vector2(0, 1), Vector2(1, 1)]
var player_path = path
player_path[0] = Vector2(32, 32)
print(player_path)
print(path)
What prints is this:
[(32, 32), (1, 1)]
[(32, 32), (1, 1)]
And what I expected it to print is this:
[(32, 32), (1, 1)]
[(0, 1), (1, 1)]
Why when I change player_path values do path values change?
Please choose better titles. Somthing like ‘Problem with Dictionary’
whiteshampoo | 2021-01-30 08:09