GUI Scrollbar can't be clicked
I made a scrollable GUI that looks right and works with the scrollwheel. I just can't understand why it's not being able to scroll by clicking the thumb on the side. Here's the code, everything looks...
View ArticleDetect click on dynamically generated mesh in Unity2d
Hi ! I am working on a simple game which requires dynamic generation of meshes of shape representing pipes in 2d. After cracking the problem of creating dynamic meshes now I am not getting how to...
View ArticleSet URL as clickable in Lable string
Hi all, How can we achieve this? I've a string with urls lets say "something http://www.google.com again http://www.amazon.com" or "http://www.google.com nexturl http://www.amazon.com". Now what I want...
View ArticleDetecting Click on a Quad
I have a quad set in a menu scene. I want it to be clickable. I'm using: void Update () { var ray = Camera.main.ScreenPointToRay(Input.mousePosition); var hit : RaycastHit;...
View ArticleClickable sphere?
Ok so I've justs started on a "Ball hitting game." I need a script that when I click on a ball it disappears. Can anyone help me?
View Articlehow to close GUI.window
I created one GUI.window,now I want to click button closing GUI.window.how to close GUI.window.Thanks.
View ArticleWhat Assests to use for a large clickable sphere?
So I want to make a large sphere with clickable squares/ pixels. What assets would I use for that?
View Article2D sprite appearing and dissapearing when clicked
Hello everyone, I'm attempting to make a 2D clicking game and I'm really new to this kind of thing. I was just wondering how to make a 2d sprite appear randomly somewhere on the screen and then...
View ArticleGUI focus and draw order mixed
So I have a GUI window with a few text fields. when the user enters text a suggestion box appears below one of them. my problem is that I have to draw the box after the other controls so it appears on...
View ArticleHow to make GUI object prevent clicking/touching what is under it?
Hello there. I am making a Turn-based strategy game. In my scene, I have a grid of tiles. I have a few buttons(GUITextures) that are meant to make the player decide whether he wants to move, attack, or...
View ArticleBoxCollider 2D not working OnMouseDown()
Hello everyone. I am kinda new to Unity, and I have a question: I can't seem to get to work a BoxCollider2D with an OnMouseDown() script attached. I have two different scenes. In the first scene, this...
View ArticleQuestion about OnMouse events
So i'm making a game and i have some clickable objects that just destroy themselves at click. When i build the .apk unity gives me a warning:> Game scripts or other custom code> contains OnMouse_...
View ArticleError destroying single objects on click
So i have this code in one object: void FixedUpdate(){ if (Input.GetMouseButtonDown(0)){ RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);...
View ArticleSelect un-selectable Objects with mouse.
**(Problem)** I have came across a pretty annoying issue, I need to select a game object that does not have a single selectable component. Which is infuriating because I have alot of those kinds of...
View ArticleClicked object not reacting appropriately
I am trying to make a game where boxes drop from the sky and you have to click them before they hit, so the boxes go flying away (you have magical powers c: ) Anyways, I am trying to use RaycastHit2D...
View ArticleMaking an object clickable on proximity
Hello, I'm currently building an item gathering system for my game. The way it works is that when the player is near the object, the object will become clickable. Upon clicking the object, the object...
View Article[4.6 - UI] Create canvas object/ UI from script C#
I just curious, can we create canvas/other ui objects into scene from script, like load prefabs into scene. Because it's just too much object if we create all canvas at first an make it unactive. I...
View ArticleSprites under other Sprites are still clickable
Hey there guys! I'm having a problem with clickable sprites. My game shows up an "instrucions window" and sprites (treated as buttons) that are under it (hidden...), are still clickable! For the click...
View ArticleClickable area problem?
I've had a crack at making my first game. You can see it [HERE][1] as it might give you a bit more insight in to my question. When you click on the game case it issues the OnMouseDown function and from...
View ArticleMake an object respond to a click in c# only when a variable equals a certain...
I have a working script to make the object respond to a click, but I only want it to respond when a certain variable equals a certain value. ---------- Here is my c# code: using UnityEngine; using...
View Article