Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | SwordRunning |
if Input.is_key_pressed(KEY_1):
var Item = get_node("Icon")
var ItemD = Item.duplicate()
ItemD.position = get_viewport().get_mouse_position()
add_child(ItemD)
I am trying to duplicate something on the icon but it appears really off.
Have you tried get_global_mouse_position()
or checked anchors, margins and offset of the icon?
dewcked | 2021-11-22 08:22
also You should try applying change to global_position instead of position
Inces | 2021-11-22 15:33
They all seem fine and get_global_mouse_position()
changed nothing.
SwordRunning | 2021-11-22 20:20
same thing happened with global_position
SwordRunning | 2021-11-22 20:21
Also you checked Every ancestor nodes’ anchors, margins, rect_position, position?
dewcked | 2021-11-23 05:21