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
-1
Question by ultimateronsu17 · Jun 03, 2015 at 11:44 AM · scripting problem

error CS8025: Parsing error help!

ok so it says parsing error on the following code

using UnityEngine; using System.Collections;

public class TPAnimator : MonoBehaviour { public enum Direction { Stationary, Forward, Bacward, Left, Right, LeftForward, RightForward, LeftBackwards, RightBackward }

 public enum CharacterState
 {
     Idle, Running, RunningBackward, StrafingLeft, StrafingRight, Jumping,
     Falling, Landing, Climbing, Sliding, Using, Dead, ActionLocked
 }
 public static TP_Animator Instance;


 }

 public Direction MoveDirection { get; set; }
 public CharacterState State { get; set; }

 void Awake () 
 {
     Instance = this;
 }

 void Update () 
 {
     DetermineCurrentState();
     ProcessCurrentState();

     Debug.Log("Current Character State: " + State.ToString());
 }

 public void DetermineCurrentMoveDirection()
 {
     var forward = false;
     var backward = false;
     var left = false;
     var right = false;
             
     if (TP_Motor.Instance.MoveVector.z > 0)
         forward = true;
     if (TP_Motor.Instance.MoveVector.z < 0)
         backward = true;
     if (Tp_Motor.Instance.MoveVector.x > 0)
         right = true;
     if (Tp_Motor.Instance.MoveVector.x < 0)
         left = true;

     if (forward)
     {
        if (left)
            MoveDirection = Direction.LeftForward;
        else if (right)

            MoveDirection = Direction.RightForward;
 
 void DetermineCurrentState()
 {
     if (State == CharacterState.Dead)
         return;

         if (!Tp_Controller.CharacterController.isGrounded)
         {
             if (State != CharacterState.Falling &&
                 State != CharacterState.Jumping &&
                 State != CharacterState.Landing)
         {
                 //We Should be falling
         }
         if (State != CharacterState.Falling &&
             State != CharacterState.Jumping &&
             State != CharacterState.Landing
             State != CharacterState.Using &&
             State != CharacterState.Climbing &&
             State != CharacterState.Sliding)
         {
             switch (MoveDirection)
             {
                 case Direction.Stationary:
                     State = CharacterState.Idle;
                 case Direction.Forward:
                     State = CharacterState.Running;
                 case Direction.Bacward:
                     State = CharacterState.RunningBackward;
                 case Direction.Left:
                     State = CharacterState.StrafingLeft;
                 case Direction.Right:
                     State = CharacterState.StrafingRight;
                 case Direction.LeftForward:
                     State = CharacterState.Running;
                 case Direction.RightForward:
                     State = CharacterState.Running;
                 case Direction.LeftBackwards:
                     State = CharacterState.RunningBackward;
                 case Direction.RightBackward:
                     State = CharacterState.RunningBackward;
             }
         }
     }
 }

 void ProcessCurrentState()
 {
      switch (State)
     {
         case CharacterState.Idel:
             break;
         case CharacterState.Running:
             break;
         case CharacterState.RunningBackwards:
             break;
         case CharacterState.Idel:
             break;
         case CharacterState.StrafingLeft:
             break;
         case CharacterState.StrafingRight:
             break;
         case CharacterState.Jumping:
             break;
         case CharacterState.Falling:
             break;
         case CharacterState.Landing:
             break;
         case CharacterState.Climbing:
             break;
         case CharacterState.Sliding:
             break;
         case CharacterState.Using:
             break;
         case CharacterState.Dead:
             break;
         case CharacterState.ActionLocked:
             break;
     }
 }

}

whats is the problem!?

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 Sisso · Jun 03, 2015 at 03:08 PM 0
Share

http://unity3d.com/learn/tutorials/modules/beginner/scripting

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by goblin4444 · Jun 03, 2015 at 03:07 PM

you forgot a { at line 6

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 $$anonymous$$ · Jun 03, 2015 at 03:13 PM

delete the } at line 9. In the line 47 put

else { if (right) MoveDirection = Direction.RightForward; } }

Parsing error normally comes from missing "{}".

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Problems With Damaging Enemies on Trigger 0 Answers

Rigidbody2D.IsKinematic giving object reference not set? 0 Answers

Separating Procedurally Generated Mesh, Based On Triangle Height 1 Answer

How are Vector2 and Vector3 interchangeable from a code standpoint 1 Answer

[Visual effects graph] How to write custom VFX Blocks ? (the proper way) 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