Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by $$anonymous$$ · Aug 29, 2014 at 03:33 AM · animationjavascriptactivegui texture

GameObject.active won't enable a GUITexture?

Ugh. First, I just wanna say, to all those people who help programming noobs like me, thanks. You, all of you people who help others, thank you.

Now, onto the question. I am trying to create a very VERY simple script to where these are called in an animation. The cam looks to the left, hears breathing, looks to the right sees monster, then it is supposed to open a GUITexture with the games main Banner on it. But, sadly, it won't load the texture AT ALL. I have tried Awake and Start, but it won't do anything. I have tried Debug.Logging it. It is active when the animation calls it but it doesn't show. I have tried all of my lacking knowledge of how to fix an otherwise working script, but it won't show the GUI. Here is the script: #pragma strict

 var EBanner : GameObject;
 var LevelNum : int;
 var BreathingAudio : AudioSource;
 
 function Start ()
 {
     EBanner.active = false;
 }
 
 function Breathing ()
 {
     BreathingAudio.Play();
 }
 
 function Banner ()
 {
     EBanner.active = true;
 }

Just a tip about the LevelNum variable, it is going to load the next scene after I fix this problem. I figure, that if this won't work, I may do it via the animation window. Anyways, any tips?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Eric5h5 · Aug 29, 2014 at 03:44 AM 0
Share

Note that GameObject.active is deprecated; you should use SetActive ins$$anonymous$$d.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Armideon · Aug 29, 2014 at 04:52 AM

A quick suggestion here, and I will go into unity and rewrite your script to confirm my information. I am no coding expert myself. But first your EBanner variable should be a Boolean because you're asking the engine to identify true or false. Also you need more lines of code. All your doing is calling functions in your script. These functions need arguments. The compiler need to know if the camera is in this position then execute this function, if not then execute that function. In your breathing function, you are calling a script, but the compiler does not know what to do with that called function. Like I said I'm no expert and I will do my best to rewrite this into something working for you. But if you understood my suggestions maybe you can rewrite a solution before I am able to submit a working one to you. Also maybe a more seasoned veteran will come across this and give you better info. Good luck zany which way

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

23 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Animation not being played! 0 Answers

Can I make animations snap to a frame? 1 Answer

How to create physics based animation character like in (GANG BEASTS)? 2 Answers

Create animation clip without "using UnityEditor" 1 Answer

Animation stops working after SetActiveRecursively() 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges