-
-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Hello,
I noticed this while actually trying to do some benchmarks but it seems the behaviour for the call to Node:duplicate is not the same as what happens with gdscript, mainly that it doesn't seem to duplicate, the node id that it is given is the same.
You can easily replicate this with:
local luaexample = {
extends = Node2D,
}
function luaexample:_ready()
local n = Node:new()
local d1 = n:duplicate()
local d2 = n:duplicate()
print(n, d1, d2)
end
return luaexampleand the gdscript version to compare:
extends Node2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
var n = Node.new()
var d1 = n.duplicate()
var d2 = n.duplicate()
print(n, d1, d2)If I've just misunderstood how to use the duplicate api then I apologise in advance.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working