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 GAMEGEEK99 · Oct 17, 2012 at 12:29 AM · error

How to Fix Compilier Errors?

How do I fix global compilier errors so I can go into playmode?

using UnityEngine; using System.Collections; using System.Collections.Generic;

[System.Serializable] public class LegInfo { public Transform hip; public Transform ankle; public Transform toe; public float footWidth; public float footLength; public Vector2 footOffset; [HideInInspector] public Transform[] globallegChain; [HideInInspector] public Transform[] footChain; [HideInInspector] public float legLength; [HideInInspector] public Vector3 ankleHeelVector; [HideInInspector] public Vector3 toeToetipVector; [HideInInspector] public Color debugColor; }

[System.Serializable] public class MotionGroupInfo { public string name; public IMotionAnalyzer[] motions; public Interpolator interpolator; public float[] GetMotionWeights(Vector3 velocity) { return interpolator.Interpolate(new float[] {velocity.x, velocity.y, velocity.z}); } }

[System.Serializable] public class LegControllerglobal : MonoBehaviour { public float groundPlaneHeight; public AnimationClip groundedPose; /[HideInInspector]/ public Transform rootBone; public Transform root { get { return rootBone; } } public LegInfo[] legs; public MotionAnalyzer[] sourceAnimations; [HideInInspector] public bool initialized = false; [HideInInspector] public MotionAnalyzerBackwards[] sourceAnimationsBackwards; [HideInInspector] public Vector3 m_HipAverage; public Vector3 hipAverage { get { return m_HipAverage; } } [HideInInspector] public Vector3 m_HipAverageGround; public Vector3 hipAverageGround { get { return m_HipAverageGround; } } [HideInInspector] public IMotionAnalyzer[] m_Motions; public IMotionAnalyzer[] motions { get { return m_Motions; } } [HideInInspector] public IMotionAnalyzer[] m_CycleMotions; public IMotionAnalyzer[] cycleMotions { get { return m_CycleMotions; } } [HideInInspector] public MotionGroupInfo[] m_MotionGroups; public MotionGroupInfo[] motionGroups { get { return m_MotionGroups; } } [HideInInspector] public IMotionAnalyzer[] m_NonGroupMotions; public IMotionAnalyzer[] nonGroupMotions { get { return m_NonGroupMotions; }} public void InitFootData(int leg) { // Make sure character is in grounded pose before analyzing gameObject.SampleAnimation(groundedPose,0); // Give each leg a color Vector3 colorVect = Quaternion.AngleAxis(leg*360.0f/legs.Length, Vector3.one) Vector3.right; legs[leg].debugColor = new Color(colorVect.x, colorVect.y, colorVect.z); // Calculate heel and toetip positions and alignments // (The vector from the ankle to the ankle projected onto the ground at the stance pose // in local coordinates relative to the ankle transform. // This essentially is the ankle moved to the bottom of the foot, approximating the heel.) // Get ankle position projected down onto the ground Matrix4x4 ankleMatrix = Util.RelativeMatrix(legs[leg].ankle,gameObject.transform); Vector3 anklePosition = ankleMatrix.MultiplyPoint(Vector3.zero); Vector3 heelPosition = anklePosition; heelPosition.y = groundPlaneHeight; // Get toe position projected down onto the ground Matrix4x4 toeMatrix = Util.RelativeMatrix(legs[leg].toe,gameObject.transform); Vector3 toePosition = toeMatrix.MultiplyPoint(Vector3.zero); Vector3 toetipPosition = toePosition; toetipPosition.y = groundPlaneHeight; // Calculate foot middle and vector Vector3 footMiddle = (heelPosition + toetipPosition)/2; Vector3 footVector; if (toePosition==anklePosition) { footVector = ankleMatrix.MultiplyVector(legs[leg].ankle.localPosition); footVector.y = 0; footVector = footVector.normalized; } else { footVector = (toetipPosition - heelPosition).normalized; } Vector3 footSideVector = Vector3.Cross(Vector3.up, footVector); legs[leg].ankleHeelVector = ( footMiddle + (-legs[leg].footLength/2 + legs[leg].footOffset.y) footVector + legs[leg].footOffset.x footSideVector ); legs[leg].ankleHeelVector = ankleMatrix.inverse.MultiplyVector(legs[leg].ankleHeelVector - anklePosition); legs[leg].toeToetipVector = ( footMiddle + (legs[leg].footLength/2 + legs[leg].footOffset.y) footVector + legs[leg].footOffset.x footSideVector ); legs[leg].toeToetipVector = toeMatrix.inverse.MultiplyVector(legs[leg].toeToetipVector - toePosition); } public void Init() { // Only set initialized to true in the end, when we know that no errors have occurred. initialized = false; Debug.Log("Initializing "+name+" Locomotion System..."); // Find the skeleton root (child of the GameObject) if none has been set already if (rootBone==null) { if (legs[0].hip==null) { Debug.LogError(name+": Leg Transforms are null.",this); return; } rootBone = legs[0].hip; while (root.parent != transform) rootBone = root.parent; } // Calculate data for LegInfo objects m_HipAverage = Vector3.zero; for (int leg=0; leg sourceAnimationBackwardsList = new List(); for (int i=0; i motionGroupNameList = new List(); List motionGroupList = new List(); List> motionGroupMotionLists = new List>(); List nonGroupMotionList = new List(); for (int i=0; i()); } motionGroupMotionLists[motionGroupNameList.IndexOf(groupName)].Add(motions[i]); } } m_NonGroupMotions = nonGroupMotionList.ToArray(); m_MotionGroups = motionGroupList.ToArray(); for (int g=0; g0.5f) aChange = aChange-1; if (bChange>0.5f) bChange = bChange-1; offsetChanges[i] += aChange 5.0f / springs; offsetChanges[j] += bChange * 5.0f / springs; } } } // Apply new offset changes float maxChange = 0; for (int i=0; i

Comment
Add comment · Show 3
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 DaveA · Oct 17, 2012 at 12:41 AM 0
Share

Please edit, format your code with the 010/101 button

avatar image aldonaletto · Oct 17, 2012 at 01:10 AM 0
Share

Where have you found this script? There are many parts missing! You could edit the question and paste the code again - but this time leave a blank line between the text and the code, then select the code and press Ctrl-$$anonymous$$ to format it

avatar image Kryptos · Oct 17, 2012 at 08:18 AM 0
Share

Sorry I'm not a compiler. What is the error message? Which line?

0 Replies

· Add your reply
  • Sort: 

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

12 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Out of Range Exception 1 Answer

not compiling for android 2 Answers

(FIXED)Unity never stops crashing... help ASAP 2 Answers

NullReferenceExeption: Object reference not set to an instance of an object. 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