Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Stop InputField from exiting when pressing enter?

Discussion in 'Immediate Mode GUI (IMGUI)' started by kaysteinhoff2003, Jul 20, 2020.

  1. kaysteinhoff2003

    kaysteinhoff2003

    Joined:
    Mar 22, 2020
    Posts:
    19
    Hi there! I'm trying to make a coding game and so far have tried to let the user input his code through an input field but I ran into the problem of the input field exiting when enter is pressed. Can I disable this? Or should I try to let the user input his code another way?
     
  2. kaysteinhoff2003

    kaysteinhoff2003

    Joined:
    Mar 22, 2020
    Posts:
    19
    E
    Edit: I could solve the problem myself. I just set the content type to custom and then changed the line type from single to Multi Line Newline. :)