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 Dryden Richardson · Feb 23, 2011 at 08:23 PM · syntax-erroreof

An EOF Problem :( (New)

From my first post i was having this problem and some one asked for the entire code, well here it is, also can you tell me what was the problem with it and how i can fix it if i get another problem with this?

var normalSpeed:float = 6.0; private var speed:float = normalSpeed; var runSpeed:float = 12.0; private var jumpSpeed:float = speed*1.7; var gravity:float =20.0; private var walkTime:int=0; private var moveDirection:Vector3 = Vector3.zero; static var grounded:boolean=false; private var controller:CharacterController; private var flags:CollisionFlags; private var tr:int = 90;

function Start(){ animation.wrapMode = WrapMode.Loop; animation["run"].layer=-1; animation["walk"].layer=-1; animation["idle"].layer=-1; animation.SyncLayer( -1);

animation["jump"].layer=10; animation["jump"].wrapMode=WrapMode.Once; animation.SyncLayer(10);

animation.Stop(); animation.Play("idle"); }

function FixedUpdate (){ if(grounded){ moveDirection = new Vector3(Input.GetAxis("Horizontal"),0,0); moveDirection*=speed; if(Input.GetButton("Jump")){ moveDirection.y = jumpSpeed; animation.CrossFade("jump");

    }
   ***"My problem is the else below"***
 }  
   }else{
   moveDirection=new Vector3(Input.GetAxis("Horizontal"),moveDirection.y/speed,
   moveDirection*=speed;

moveDirection.y -=gravity*Time.deltaTime; controller=GetComponent(CharacterController); flags=controller.Move(moveDirection*Time.deltaTime);

grounded=(flags & CollisionFlags.CollidedBelow) !=1;

if(moveDirection.x>0){ tr=90; }else if(moveDirection.x<0){ tr=270; }

transform.eulerAngles.y-=(transform.eulerAngles.y-tr)/5;

if(Input.GetAxis("Horizontal")>.2|| (Input.GetAxis("Horizontal")<-.2)){ if (walkTime>40){ animation.CrossFade("run"); speed=runSpeed; }else{ walkTime++ ; animation.CrossFade("walk"); speed = normalSpeed; } jumpSpeed=speed*1.7;

}else{ walktime=0; animation.CrossFade("idle"); } } @script RequireComponent(CharacterController)

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 Jessy · Feb 23, 2011 at 09:07 PM 0
Share

Please look at a post when you make it. >:-|

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Aldwoni_legacy · Apr 19, 2011 at 08:31 AM

remove the } before the else

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
-1

Answer by supergamespawn · Sep 26, 2011 at 04:18 AM

please help im getting all sorts of errors im fixing them but getting more and im new so im trying to figure it out this is supposed to a aim down sights script

var aim : boolean = false; var cam : GameObject;

function Update () {

 if(Input.GetMouseButtonDown(1)){
 
 Aim = true;
 
 if (Aim == true){
 
 Camera.active = true;
 

}

if(Input.GetMouseButtonUp(1)) {

Aim = true;

if(Aim){

Camera.Active = false;}

 }
  

}

}

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 syclamoth · Sep 26, 2011 at 06:54 AM 0
Share

Post this as a new question please! Don't just raise some totally unrelated question from the grave like that!

avatar image
0

Answer by DaveA · Feb 23, 2011 at 09:59 PM

EOF's usually mean you're missing a } somewhere. You should really work on your indentation. I find that lining { } right above/below each other (not at the btginning/end of lines) helps a lot to visually identify such problems, but your editor should also highlight the matching braces.

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 ShadowBroker · Apr 19, 2011 at 09:00 AM 0
Share

Sometimtes ist also if you used / and the / is missing. Just my two cents :3

avatar image DaveA · Apr 19, 2011 at 05:08 PM 0
Share

Very true. Syntax highlighting can really help with that, if you see parts of your file (esp the end) colored comment-color. Also brace-matching is handy.

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

2 People are following this question.

avatar image avatar image

Related Questions

An EOF Problem :( 1 Answer

EOF error message 2 Answers

sript gets error 2 Answers

BCE0044: expecting }, found 'class' alond with BCE0044: expecting EOF, found 'Card' 1 Answer

what is an unexpected token 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