Problem in the keyboard screen by Input Field TMP in the unity c# - c#

Why when I select InputField TMP in the unity c# the keyboard screen appears correctly, but when I select another InputField TMP it disappears and I have to click on it again for it to appear. I want to keep keyboard screen when moving from one InputField TMP to another without disappearing
Why when I select InputField TMP in the unity c# the keyboard screen appears correctly, but when I select another InputField TMP it disappears and I have to click on it again for it to appear. I want to keep keyboard screen when moving from one InputField TMP to another without disappearing

Related

How to get mouse inputs in Rider's Console to do a Minesweeper

I'm trying to do a Minesweeper in C# using the Rider's Console. At this time, I get the inputs by asking the player to enter coordinates using Console.ReadLine but I want to go to the next level and wait for the player to click on a cell of the board with the mouse.
But how to get mouse inputs, how to get different inputs whether the left or the right click is pressed and most importantly, how to know the coordinates of where the player clicked?

Interacting with objects in SteamVR

I'm trying to get Interaction setup in my scene for a colour memory puzzle game in Unity.
I've managed to get the scene changing when the player interacts with a button on a Canvas, so I'm trying to somehow replicate that through a puzzle.
The player can trigger the colour randomizer to display random colours (out of 4), then the player will need to 'press' the buttons on the panel in the correct order to proceed.
So far, I have a canvas overlapping the buttons so the player can interact with them. Each button has a box collider over the button element, so when the mouse is clicked or the trigger button is pressed on the Oculus controller, it should register a button press. But as soon as the hand comes into contact with the 'collider box' the following NullReferenceException Shows;
NullReferenceException: Object reference not set to an instance of an object.
Valve.VR.SteamVR_Action_Boolean_Source.UpdateValue()
I'm trying to figure out a way to reference each 'box' in code to that it knows its that specific colour being pressed. The code is there to accept keyboard input, just having trouble with the VR element.

Clicking anywhere triggers the button

In my scene, I have this set-up:
Game Controller
Level Controller
Main Camera
Event System
Canvas
Player
PlayerCanvas (Render Mode is World Space)
Button
I set the PlayerCanvas into the same width and height of the button. And both of them are just small. I put Debug.Log to check everytime I press the button. But somehow, it triggers the button even if I click way off the screen. Can help to explain why is this happening. Thanks!
Note: I'm trying to add a button beside the Player so that even if the Player moves, the button will just follow.
I think your hierarchy is wrong.
Try something like
Game Controller
Level Controller
Main Camera
Player
Event System
Canvas (Screen Space - Overlay)
Button
Not sure what Player is, but I'm sure on my hierarchy Event System and Canvas are on the same level. And every button is son of Canvas. Not sure you can make multiple Cavas (you should not need it anyway).

Unity Button Animation

Does anyone know a possible way for an animation that makes it so when a button gets clicked text pops up above the button that says [Clicked]. It must fade away after 3 seconds and it continues to go up. (The text will move up.)
Pretend like this is how it would look
Clicked but faded away
Clicked
Clicked
Clicked
Button
(Unity Using C#)
How about using a Prefab for this?
You'd create a Prefab with a root object and a text label as a child. Then you animate the text label upwards and fading out over three seconds using the Unity animation window.
On button click, you instantiate the prefab, make it a child of the button, and position it at the same position as your button AND auto-destroy it after 3 seconds.
Here's a code example, pretending that your prefab name is "myAnimatedText"
GameObject animatedButtonText = Instantiate(Resources.Load("myAnimatedText"), transform);
animatedButtonText.transform.position = transform.position;
Destroy(animatedButtonText, 3.0f);

unity 5 button not showing up in editor

I'm trying to create a start menu for my unity 5.3.1 game by following this tutorial : https://www.youtube.com/watch?v=pT4uca2bSgc
I followed everything he said up to the part when he attached the script to the start button on the main menu screen. Here is a picture of my code and editor:
Any help is appreciated thanks.
You have attached that Title script to the "canvas" Canvas Game Object - not the "start1" Button Game Object.
In reality in doesn't matter, because you can tell your button to call any method on any game object when clicked.
To do that, select your button, for the OnClick event drag the Canvas game object, then from the drop down select the Title script and the startLevel() method.
Now when you click the button your level will load.

Categories