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 /
avatar image
0
Question by Mathias · Nov 14, 2010 at 10:52 AM · falsetrue

true and false wont work!

Hello everyone, well it seems that unity wont reconise the words true and false. Is there anything that i can do to make unity reconise thoes words. I find ot pretty hard making a some sort of "dying" script without using true and false. I have tried reinstalling Unity but it is still the same. Please help me Thanks!

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 · Nov 14, 2010 at 10:53 AM 1
Share

Can you please post your script? 'true' and 'false' should work fine. Have you written it all in lower-case?

4 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by alienx2 · Nov 14, 2010 at 01:42 PM

make sure use code "var : boolean = true;" before start type code...:)

example:

var ready : boolean = true;

function Start() { print("the answer is"+ ready); //See your console "the answer is true"

 yield WaitForSeconds(1); //Take a break for 1 second

 ready = false;
 print("the answer is"+ ready); //See your console "the answer is false"

}

Comment
Add comment · Show 4 · 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 Jesus_Freak · Nov 14, 2010 at 03:56 PM 0
Share

or in javascript, you could just do

var ImAlive = true; var ImDead = false;

avatar image Mathias · Nov 14, 2010 at 08:00 PM 0
Share

No none of the suggestions helped but thanks!. One of my scripts look like this:

var IsQuitButton = false

function On$$anonymous$$ouseEnter () { //Change the color when mouse hovers over text.

 renderer.material.color = Color.black;   

}

function On$$anonymous$$ouseExit () { //Change the color of the text when mouse hovers away from text back to default.

 renderer.material.color = Color.white;

}

it wont change the word false into a diffrent color and with out this i cant make a main menu.

avatar image boymeetsrobot · Nov 14, 2010 at 10:00 PM 0
Share

your code should be var IsQuitButton : boolean = false;

avatar image alienx2 · Nov 15, 2010 at 06:59 AM 0
Share

yes agreed with boymeetsrobot... similar to look up example code :)

avatar image
-1

Answer by john-essy · Aug 02, 2011 at 02:53 PM

@Jono 1 `Transform.position = Vector3(0.0002233056,0.2736679,-3.468594)` I can't remember what it is exactly but it is like this
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
avatar image
-3

Answer by Jono 1 · Nov 29, 2010 at 06:26 AM

I am having the same problems can someone take this script and change it so u respawn when you press "r" to this location 0.0002233056,0.2736679,-3.468594 the bullit var is called fireBall the script is for a coco nut that can move and shoot the coco nut is called Sphere in the hierachy i wan't to respawn when the fireball hits me THANKS!

var speed = 3.0; var rotateSpeed = 3.0; var bullitPrefab:Transform;

function Update ()
    {
        var controller : CharacterController = GetComponent(CharacterController);
        transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);
        var forward = transform.TransformDirection(Vector3.forward);
        var curSpeed = speed * Input.GetAxis ("Vertical");
        controller.SimpleMove(forward * curSpeed);

        if(Input.GetButtonDown("Jump"))
        {
            var bullit= Instantiate(bullitPrefab,GameObject.Find("SpawnPoint").transform.position,
            Quaternion.identity);
            bullit.rigidbody.AddForce(transform.forward * 2000);

        }
    }




@script RequireComponent(CharacterController)
Comment
Add comment · Show 2 · 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 Eric5h5 · Nov 29, 2010 at 06:35 AM 0
Share

This isn't an answer.

avatar image john-essy · Aug 02, 2011 at 02:54 PM 0
Share

Whoa where my post go?

avatar image
0

Answer by denewbie · Nov 14, 2010 at 01:25 PM

Unity scripts do recognise true and false be it the mono or javascript.

If you're having some problems with your scripting maybe you could post some of it so we could help out more.

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

1 Person is following this question.

avatar image

Related Questions

Why does this simple script not work????? 0 Answers

Image remain invisible but wanted it to become visible 0 Answers

True False What am I doing wrong. 1 Answer

True and False values with If and else 1 Answer

Boolean Uncheck Inspector if False 2 Answers


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