I think you forgot to change the name of the script on the item.
If it has a class_name on it, use that name, otherwise add the following line at the top of the the script: class_name DropItem
func Calculate_Drops(Xp_Drop_Amount : int):
var Random_Number = randi() % 100
if Random_Number <= 100: # The Player got the drop. the value is 100 because the testing for picking it up.
Xp_Drop_Amount *= 2
player_character.XP += Xp_Drop_Amount
var Drop = Possible_Drop.duplicate()
Drop.position = position
node_2d.add_child(Drop)
Drop.visible = true
print(Drop.position,position,Drop.get_node("Pickup_Radius").position)
to
func Calculate_Drops(Xp_Drop_Amount : int):
var Random_Number = randi() % 100
if Random_Number <= 100: # The Player got the drop. the value is 100 because the testing for picking it up.
Xp_Drop_Amount *= 2
player_character.XP += Xp_Drop_Amount
var Drop = Possible_Drop.duplicate(DUPLICATE_SCRIPTS)
print("dropped item: '", Drop.name, "', has script func?", Drop.has_method("_on_pickup_radius_body_entered"))
Drop.position = position
node_2d.add_child(Drop)
Drop.visible = true
print(Drop.position,position,Drop.get_node("Pickup_Radius").position)
okay, that means that the script should be copied when we pass the flag explicitely
lets change this back to
var Drop = Possible_Drop.duplicate()
I’ve tested duplicating nodes locally, and it seems like not providing any arguments would be what you want - it also copies signals from child nodes.
My guess is that everything is duplicated correctly and the issue is somewhere in the script / node that you copy. E.g. maybe there is no area on the Drop item that has a signal to the_on_pickup_radius_body_entered() function.
Did you already test putting the Drop node somewhere in your level to test pick up?
_
Lastly, you also might want to consider
using different nodes for pickup and held item, this saves you from having different behaviours mixed together in your code.
creating a scene for the drop item and instantiate this scene instead of duplicating a node. You can pass the necessary data in the same way you already pass the position information
i dont know what happened but it works now! i copied your script that you again put and removed the “DUPLICATE SCRIPTS” and it works! thank you for taking the time to reply like almost 30 times.