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
-2
Question by Bramburyk · Jan 07, 2011 at 07:25 PM · javascript

Script problem...

I have a problem with a script...

static var LapNumberPlayer : int = 1;

//What lap are the bike on var CarLap: int = (LapNumberPlayer);

//What GameObject are gonna get collided with the lapcounter/Halfway var Car : GameObject;

//finish camera var PlayerCamera : GameObject; var CameraFinish : GameObject;

function OnTriggerEnter(FinishLine:Collider){ //PlayerBike LapCounter if (FinishLineBox.gameObject == (Car)) { LapNumberPlayer ++; print ("Current Lap Player:" + LapNumberPlayer); } }

 //detects who won and \camera finish       if (FinishLineBox.gameObject == (Car))
      {
         if(CarLap == 1)
            {
            Application.LoadLevel(1);
            }
      }

And I get this error : Unknowm identifier ,,FinishLineBox"...

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 yoyo · Jan 09, 2011 at 06:40 AM 0
Share

Please format your question clearly and test all code thoroughly before posting here. "Script problem" is unlikely to be a useful question for people to refer back to later.

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Loius · Jan 07, 2011 at 07:43 PM

Somewhere you use "finish line box" but you haven't declared it anywhere. The code you posted (which looks to have been poorly formatted) doesn't appear to use it, so I don't know where your problem is.

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
0

Answer by Ridgerunner · Nov 10, 2012 at 02:58 AM

Okey here is the script when I'm in the Level Select I go to the first level, Level 1 it Countdown fine and game over I go Back to Level Select but when go back in the same level 1 again the Timer is still at 000 how do I fix it?????????

var aniFont1 : GameObject; var aniFont2 : GameObject; var aniFont3 : GameObject;

var playTime : float = 0.0; var continueTimeDown : float = 0.0; var countDownDelay : float = 0.0; var countDownAmount : float = 150;

var playTimeEnabled : boolean = true; var countDownEnabled : boolean = true;

function aniSprite ( spriteObject, columnSize, rowSize, colFrameStart, rowFrameStart, totalFrames, type:String) { var index : int = playTime; var font1 = ( index % 10 ); var font2 = ( ( index - font1 ) / 10 ) % 10; var font3 = ( ( index - font1 ) / 100 ) % 10;

if ( type == "font1" ) index = font1; if ( type == "font2" ) index = font2; if ( type == "font3" ) index = font3; var size = Vector2 ( 1.0 / columnSize, 1.0 / rowSize );

var u = index % columnSize; var v = index / columnSize; var offset = Vector2 ( ( u + colFrameStart ) size.x, ( 1.0 - size.y ) - ( v + rowFrameStart ) size.y ); spriteObject.renderer.material.mainTextureOffset = offset; spriteObject.renderer.material.mainTextureScale = size; } function Update () { if (aniFont1 != null) aniSprite ( aniFont1, 10, 1, 0, 0, 10, "font1" ); if (aniFont2 != null) aniSprite ( aniFont2, 10, 1, 0, 0, 10, "font2" ); if (aniFont3 != null) aniSprite ( aniFont3, 10, 1, 0, 0, 10, "font3" );

if ( playTimeEnabled && countDownEnabled ) { playTime = countDownDelay - Time.time + countDownAmount + continueTimeDown; } if ( playTime <= 0 ) { playTimeEnabled = false; countDownEnabled = false; } }

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

Setting Scroll View Width GUILayout 1 Answer

Can someone help me fix my Javascript for Flickering Light? 6 Answers

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Have to press Fire1 button twice to run if statement? 1 Answer

foreground gui layer on top of another based on relative position of background gui 0 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