#Viewport is behaving strangely

13 messages · Page 1 of 1 (latest)

odd iron
#

Hi I have a couple of problems with the coordinates of my viewport. Trying to do some things that are not working:

  • when trying to making a character walk toward where I click, it just...walks off?
  • Trying to spawn words at a certain place that are definitely spawning according to remote and the breakpoints
  • UI is in the wrong place (although that might be because I put a camera on my player, it was fine before that)

I would love some advice on how to fix these issues!
Thank you in advance

dusk carbon
#

hi! I copied the movement part of your code into godot and for me it works fine. Is it possible that when you placed the player there, you only moved the sprite instead of the whole player? When you click on the Character node and look at the transform, that should give you the position of the player. When you click on the sprite node the position should be 0 (or slightly higher so 0 is at its feet)

odd iron
#

Hi, thanks for checking! This is what you mean right?

dusk carbon
#

or maybe the problem is that the script is attached to the characterbody2d node instead of the root node? If you rightclick on characterbody2d and make it the scene root,does that fix it?

dusk carbon
odd iron
#

Hey that seemed to have solved it!

dusk carbon
#

yay!

odd iron
#

kinnd of, he's still flying 😛

#

but I think I can fix that

dusk carbon
#

I don't know how to help you with the other problems, sorry

odd iron
#

no worries, this is greatly appreciated 🙂

#

That also means that the other problems were unrelated haha

#

update: adding gravity did nothing, it seems my character has decided the floor is in the sky 😂