Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Mrpaolosarino |
I want to create a gun item where if I press ‘E’ then the gun will position itself to my player’s hand. I already set it up. Etc. But the problem is once I pressed the E then the gun will disappear. I try to print the gun location and it says (0,0). Any experts out there?
var Picked = false
func Picked():
if Picked == false:
var bodies = $Area2D.get_colliding_areas()
for b in bodies:
if b.name == “Player_pickup”:
self.position = get_node(“/Player/Transform2D”).position
I tried Z-index, collision layer but still, nothing has changed