0 votes

I'm trying to make a character selection screen with two players.

I basically need two rectangles hovering over a grid to select the chosen play.

You can think of a grid composed with the following elements:

 TextureButton{
    -TextureRect  
}

Each texture rect is a character avatar, and I use the focus texture of the texture button to overlay a selection rectangle above each texture.

Right now i'm facing two problems:

-How to program the two keyboard inputs separately.
-How to grab_focus() of two buttons simultaneously.

For defining which player pressed which button I am doing:

func _on_baseTextureButton_gui_input(event):
if event.is_action_pressed("special"):
    Global.Player1 = playerObject
if event.is_action_pressed("special2"):
    Global.Player2 = playerObject
pass # Replace with function body.

I hope I have been clear.

Thanks in advance.

in Engine by (25 points)
edited by

1 Answer

0 votes

Maybe use Viewports.
You can start different scenes in different viewports.

by (64 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.