Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Text input field activated by a button.

Discussion in 'Input System' started by TheBear66, Jun 11, 2020.

  1. TheBear66

    TheBear66

    Joined:
    Jun 9, 2020
    Posts:
    5
    Losing the will...

    I'm really hoping someone can help me. I have a fundamental function that i cannot get to work, I'm really hoping someone here is able to help.

    I'm trying to create a user interface that allows the user to put a String of text into an input field. There is a button next to this input field, and when the user presses said button after inputting some alphanumeric text. several things will happen.

    Firstly. I need the input field text to be 'cross referenced' against several (hundred) game objects' (sprites) names. Each of the sprites has a unique name.

    If there IS a sprite which shares the same name... I would very much like to spawn another sprite in one (scene)location and get it to move to the sprite that was originally identified.

    So that you can understand the overall effect. I am creating a grid of square sprites so that it forms a 'map' Using the grid reference (the sprites name) the user will be able to launch an airplane from off screen to attack said grid reference (sprite). I really hope this makes sense.

    I'm incredibly new to c# although i'm trying my best to catch up, and i've even got the bolt add-on to see if that would help. no luck as of yet. :-(
     
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,204
    This forum is for Unity's input system. You probably want to ask in the Scripting forum.

    Also, what have you tried? What are you unable to do? Get the input from the text field? Check the names? Move the sprite?
     
  3. TheBear66

    TheBear66

    Joined:
    Jun 9, 2020
    Posts:
    5
    Ah, sorry, i didnt realise. (it was quarter to one in the morning lol) I'f asked this question in the scripting forum now.

    I'm using bolt, and I understand the general setup of bolt, but its for the most part, getting my head around the terminology. I'm on the side learning with C# but I have this idea/concept in my head, and i'm one of those that can't move past it until it is complete.

    Basically i'm trying to make a game that emulates what an 'observer' would be able to do in real life. You have a grided area/map and by inputing the correct grid reference (of which i have used sprites to act as the relevant coordinates) you can launch an attack. Basically spawn an airplane from an off screen airport which then heads towards the grid reference sprite and drops a bomb. All from the user entering a Grid reference (text input field) and pressing 'launch' (button)