First of all let me introduce myself i am a medical student. In my school students cannot hand on any human anatomy atlas books due to its very rare . All the books that we have is only written in different language. Its very hard to understand it. But everyone has smart phones. So i found nice idea that i can develop mobile human anatomy application like essential skeleton that already developed by some genius people. So i started my journey since then i learnt 3dmax,zbrush and substance painter. Woohoo i build my first human skeleton for working so long time. Than what? i stuck with this software called UNITY. I am learning it by step by step still i got face to big problems like coding. So i am asking you guys to help me to solve these problems that i am facing, share some of your precious time and lend me some knowledge. In the end so many medical students will thank you and also appreciate those people who shared their tutorial video on youtube software i learnt.
Ok lets start
In picture below i created button. So i want this button to hide object when i click on it and i am really confuse to how to do this. Please help me Thank you
It looks like this question was already answered pretty well in your other thread here. I’m not sure what more I could add to what @romatallinn and @Dameon have already told you, so I’ll come at it from a different angle:
You’re a medical student. I imagine you’ve got a pretty full schedule as it is. Upon graduation, you stand to make a decent living as some sort of medical professional, I’d wager.
While game development may not be brain surgery, there’s still a significant amount of learning and experience required to create quality apps (using the term apps here because what you’re describing isn’t really a game, so we can eschew details like game design, difficulty balance, etc, and focus on the other programmatic and interactive elements).
I saw in another question of yours that you’re planning on making money from ads. It’s important you understand that this, being a niche product, may not generate the kind of revenue that will make it worth the cost of your time and resources to develop and maintain it.
So here’s the other thing. Essential Anatomy 3 (which I assume is what you’re showing in the screenshot here) is available for Android for $9.99. $10 is almost nothing when compared to the insane price of textbooks, so despite the fact that you can’t share them with each other, it’s still a very easy access product. Isn’t it a better deal for students to go with a product that is tried-and-true from a large, dedicated developer for a reasonable price, rather than opting into a more amateur, ad-supported option?
If I’m missing something here, please let me know. I’m not trying to discourage you away from development, but I think it’s important to be sure you’re doing it for the right reason, and that you understand the amount of work that’s going to be involved.
well thank you for your concern. The thing is none of my medical student doesn’t know English expect me. You can see from my post my English isn’t advanced as well. I don’t want to make money with it. I just want to help these students that’s all.
I have found this script. But it seems unity 5.5.0 cant recognize this function
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class hide : MonoBehaviour {
function Update() {
if (Input.GetKeyDown(KeyCode.Z)) {
// show
// renderer.enabled = true;
gameObject.GetComponent<Renderer>().enabled = true;
}
if (Input.GetKeyDown(KeyCode.X)) {
// hide
// renderer.enabled = false;
gameObject.GetComponent<Renderer>().enabled = false;
}
}
}
When you created this script and hang on the object, look at the first screenshot. There is a Button component → OnClick. You dragged the object in a field. Can you see “No function” beside? Click on that. In the drop menu choose name of the class you just created with my code above → ChangeState.
I am sorry, but I agree with @Schneider21 . This stuff about buttons is taught in any tutorial about Unity UI. Since you cannot do the simplest things by yourself, it indicates that you do not learn Unity deep enough. Therefore, you are not able to make what you want. The code I gave you will work, but it will not solve all your problems. We are not going to do that either. You have to do it, but, again, since you do not learn Unity deep enough, the result is obvious. The next issue, that you will face now, is how to make the button to disable/enable the object that is selected. This task is even harder.
Exactly. The takeaway point here, @Goldensnitch , is that you’re looking at how to solve very specific issues, which is great, but you don’t seem to have much of a plan for the larger picture. Setting an object to active/inactive is a very basic task. And while no one is born knowing how to do this, it’s covered very early in the tutorials. If you’ve already gone through the tutorials and still can’t figure out how to activate/deactivate an object, you’re going to have an impossibly difficult time doing anything else. If you haven’t gone through the tutorials, you need to get on that immediately.
I’m always very hesitant to be a naysayer, especially in this holy ground of Getting Started, since I recognize this is a place for beginners to get the help they need. But I really do think that in this case it’s worth taking the time to consider if this is the route you really want to go. Development – even with an IDE/engine like Unity – is hard. It requires a lot of time and dedicated effort to be able to even fumble your way around coherently, much less get any good at it.
Don’t interpret this as me saying “Give up.” But do think of it as challenging yourself as to whether or not you’re ready to take on this challenge, or if you even really want to take it on. If you do, put in the due diligence and learn how to use the toolset by following along with the tutorials. If you do that, you’ll be able to understand the code roma posted, and you’ll probably even have a solid idea how to move forward with the rest of what you want to accomplish.
I typically don’t actually bother with code for buttons that simply enable and disable objects. You can call GameObject → SetActive directly from the UnityEvent.
Here is a tutorial that enables and disables a bunch of GameObjects without ever writing a line of code.
Thank you again Roma. I think i found something very useful about Schneider told me to do. I didn’t know there is tutorial on this website. glad i found it