Button is not going all the way to the right in remote debuging godot

so on my pc the button to jump is all the way to the right on this blue box and will cut off if i move it any more so then it wont show on remote debuging on my samsung a14 but if its all the way to the edge on my pc it wont be on my phone i am quite new to this and have been tryna find out why it wont go to the edge on my phone and will on my pc can anyone help?

hi and welcome to the community :wave:

is this working through one of the courses?

have you got a screenshot of what your looking at please.

for the most part the anchor presets that we use for the UI elements, should be able to lock the anchor position to the right for the button, and move it into view. that way the button will allways have an offset to the right hand side.

thanks and on my pc its to the edge of the blue box but on my phone its not at the bottom right if i move it will cut off thats how it looks in the editing if i move it from the blue box it cuts off

image
even here on my pc its not all the way to the edge when i full screen the debuging but on my debug phone its way further from the edge


do i need to expand the blue box if i do how would i go about that thanks fot all the help

How are you placing the Ui buttons, are they on a canvas UI layer?

Can I have a look at hothead node tree looks please

i dont know what hot head tree mode is but yes its on a canvas layer and i am using uitouch buttons i think there called ik its a toucxh button thingy as i said i am really new just wanna learn basic code and make a fun game for me and my friends to play

image
all the code works i debugged that its just the jump button is far away from the right side on my phone and i have not found out how to fix it yet

Lol that’s my bad, flaming autocorrect on phone doing its usual wonders, should have been ‘how the…’ dunno where it got that from :frowning:

Sorry bout that.

I’ll jump on laptop and pop a few ideas together to try

thanks so much for the help just cant wrap my head around why it wont go all the way to the right on the phone like it shows in the blue box

yea, the thing with the Touch buttons is that they’re based off of a Node2D, so they dont have the normal UI positioning like anchors etc. which i kind of find strange.

whats on the screen currently with that outline is the default cameras view. but thats based on the desktop view in the editor as it is, so going full screen or changing the window size changes that area as well.

couple of things that spring to the top of my head.

you could try changing the screen resolution to that of your phone.

i dont know off the top of my head what that might be tho

and that might allow you to position them correctly.

another option might be to change the buttons to say, texture buttons as they inherit from control nodes so they can be positioned in the UI more accurately with anchors.

for example, if the Control node is set to full rect to cover the whole screen.


then the button can be positioned with its anchor in the lower right.

so if the screen size changes, it will always be based off the anchor.

another alternative if you want to keep using the touch bottons would be to position them with code when the game launches, as you get get the viewport size with

get_viewport().size

and then you could position them manually with an offset from the boundary to the right.

just a few thoughts on a couple of possible options.

not used the touch buttons myself, so not 100% the best way to use them

Darren

2 Likes

thanks ill get to trying them out and see if one fixes it

so while trying this i took where you talked about it taking from the control node and just made one and put only the touch button that makes you jump in there then anchored it to the bottom right then just move it how it needed to be moved now it works on my remote debugging and goes to the edge of my phone

image

thanks Darren for all your help

1 Like

sweet, nice use of the control as an anchor for it, never thought of using the control that way since the placement of the touch control would be relative to that.

nice work :+1:

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms