Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
This question was closed Jan 06, 2017 at 01:31 AM by JoshBaz for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by JoshBaz · Sep 08, 2015 at 02:40 PM · gameobjectbackground music

Help with my Title screen - Error CS1023 and Error 0246

I need help with this title screen I'm making for my game. First of all I'm a newbie and I am making this title screen using methods I've gathered from different sources. I keep getting error CS1023 (49,36) and error 0246 (26,9). I don't know whats wrong on line 49 and 26. What this code is basically supposed to do is hide a RawImage on the Canvas upon a keypress so that a different RawImage will be revealed, then when the second RawImage image is being displayed background music should start playing. Also if you see a better method than what I'm doing (or trying to do) please give it to me. The variable names are arbitrary by the way and have no real significance.

using UnityEngine; using System.Collections;

public class splash : MonoBehaviour {

 // Use this for initialization
 void Start () {
 
 }
 
 private string splashcurr ="notyet";
 private string titlestate ="no";
 public float splash_count = 4.0f;
 private AudioSource source1;
 
 // Update is called once per frame
 void Update () {
     if (splash_count <= 0.0f)
     splashcurr ="summon";
     else
     splash_count -= Time.deltaTime;
 }
 
 // Checks for keypress
 function Update() {
     if(Input.GetMouseButtonDown(0))
         splashcurr ="summon";
     if(Input.GetKeyDown (KeyCode.Space)){
         if (splashcurr="summon")
         splashcurr="ontitle";
         else
         splashcurr ="summon";
     }
     if(Input.GetKeyDown (KeyCode.Return))
         splashcurr ="summon";
     
     call SplashCheck;
 }
 
 // Code for checking and clicking between splashes
 void SplashCheck () {
     if(splashcurr="summon") {
         renderer.enabled=false= Gameobject.Find("IEntertain");
         splashcurr ="ontitle";
     }
     
     if(splashcurr="ontitle") {
         titlestate="now";
         Quethemusic;
     }
 }
 
 void Quethemusic () {
     if (titlestate="now")
         source1.Play();
 }

}

Comment
Add comment
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

1 Reply

  • Sort: 
avatar image
1
Best Answer

Answer by Dave-Carlile · Sep 08, 2015 at 02:48 PM

= is the assignment operator, == is the comparison operator. Line 49 should be:

 if (titlestate == "now")

Same issue on the line 26 error, you're using the assignment operator on line 24 when you mean to use comparison. The compiler isn't sure what you're trying to do so it gives you its best assessment of the problem on a later line.

 if (splashcurr=="summon")
Comment
Add comment · Show 1 · 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
avatar image JoshBaz · Nov 17, 2015 at 09:43 PM 0
Share

Thanks for your help. $$anonymous$$e and my noob mistakes.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Deleting objects at specific position 1 Answer

Create an object on mouse click? 0 Answers

GameObject Tags 1 Answer

Weapon swap system is not working at all... is there a better way to do this 0 Answers

Change the active value quickly? 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