Label moves with level in CanvasLayer

Godot Version

4.3

Question

Hi! So im making a tag game, and i want to make a label show wich player is the tagger, but it doesn’t stay on the screen, it moves with the level even though ive put it on a CanvasLayer. Why does this happen?

Edit: Ive found out it only happens to labels when the text is getting changed in a script. those without changing the text (Text: Catcher) stay.

Edit #2:
so, i checkerd again, and whats really going on is its just a random label that moves with the level, no matter if its text is getting changed or not.

Is follow viewport checked?

uhm, where can i find this checkbox? :sweat_smile:

It’s a Canvas layer property

i tried, but the problem remains

i edited the post, look at it again

@magele Show a screenshot of your scene structure and any code snippets that manipulate these labels please, it’s hard to guess what going on without it.

alright, here you go.
image

Code where it changes the text (game manager):

extends Node

var tagger = 0
var runner = 0

func _ready() -> void:
	if randi_range(1 , 2) == 1:
		tagger = 1
		runner = 2
	else:
		tagger = 2
		runner = 1


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	%Label.text = str(tagger)

please help, its a so annoying glitch. it also happens in my other games now. i updated the post.

Maybe you should delete the node and create it again.

It shouldn’t matter that you are changing the value of the Label.text in the code dynamically. You can test it by removing this piece of code from your script - the behaviour of the Label will most likely remain the same.

func _process(delta: float) -> void:
	%Label.text = str(tagger)

There has to be a parameter on the Node that is sticking its position to the global coordinates. As mentioned by @FreakyGoose - try deleting the Node and create it again, this will reset the settings to default which maybe will fix it for you.

I tried readding it, still nothing. As i said, its also happening to my other games now, so it could be a glitch in my godot version. I will try reinstalling godot and see what happens.

Ok, still nothing. Could it be that its an glitch from the engine?

Please help, its really getting annoying

Can you share your project on GitHub?
I don’t see any obvious reason why it would behave like that.

alright, but i need to set up an account real quick.

here you go: GitHub - mageleSi/tag_game: tag game from godot

The label stays in the top left corner for me, as it should be. Is the issue gone, or what?

Thats weird. Then something on my pc is wrong. Il look if anything is im the wrong place. But thanks for helping!

1 Like

so, nothing. i tried reinstalling godot, even appdata, heck i even reinstalled windows. what should i do now?