When I position my popup above the x axis Origin, it stays below this point in-game - why?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Pluto1

All I’m trying to do i position a popup in my game. After so much frustration, I came to ask here. Why can’t I position my popup above the x origin line and have it also above that line in game?? I’m so perplexed. The popup stops short of going above that line no matter where I position it.

Edit: it also stops short of going left of the Y-origin?

:bust_in_silhouette: Reply From: witch_milk

is this a 3D or a 2D game? Is the pop up animated?
Sometimes, you have to make the mesh or the popup’s properties be local to its scene, so that when its instanced whatever coords it is supposed to be at it will go to, otherwise it might be going to say 0,0,0 or 0,0 in a 2d game. This should help if the pop up is animated.

It is a 2D game. The popup is not animated, and I make it appear when the player is within a certain distance from a sprite, full code here on the popup:

extends Popup

var player
var Fish

func _ready():
	Fish = get_tree().root.get_node("/root/World/Fish")
	player = get_tree().root.get_node("/root/World/player")

func _process(delta):
	var player_relative_position = player.position - Fish.position
	if player_relative_position.length() <= 200 && Input.is_action_just_pressed("Talk"):
		popup()

So, pretty simple. I’ve tried putting it under a control node, but same result no matter where I position everything in the editor: it doesn’t want to go past (0,0) to anywhere negative when I run the game.

I’m assuming I’ll just have to position it in code? Though it still wouldn’t make sense to me…

Pluto1 | 2020-11-13 15:28

to figure out exactly what your problem is we should have the function print the location of the fish and the location of the player.
Also try instead of playing with the translation of the object to play with the objects offset instead.

I haven’t much experience with 2D, I only do 3D. But I remember having to change offset instead of translation once.

witch_milk | 2020-11-14 21:25