Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Sadakos Boyfriend · Jul 27, 2011 at 04:06 PM · errorbce0005unknown-identifier

Problem with animation code or blender?

I imported a blender file (a basic running animation)into Unity as a .FBX file.

I've used some code which i thought might play the animation when a key is pressed, but im just getting an error message: "unknown identifier: 'blockgoatrun'" ('blockgoatrun'being the name of the blender model import).

Here is the code:

var Speed = 5.0;

function Update () {

if(Input.GetKey("d")) {transform.Translate(transform.forward Speed Time.deltaTime); animation.Play(blockgoatrun); } }

Why isn't it recognising the file?

I know im making some fundamental error as i am still new to all this, im just buggered if i know what it is!

Thank you, Tom.

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Chris D · Jul 27, 2011 at 05:55 PM

If that's your complete code, the problem is that you're calling Play on the animation stored in the variable blockgoatrun which probably doesn't exist. Check out the docs on Play() here.

If the animation is attached to the gameobject already, just replace animation.Play(blockgoatrun) with animation.Play("blockgoatrun"). Play requires a string.

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 Sadakos Boyfriend · Jul 27, 2011 at 06:08 PM 0
Share

That did indeed fix the code, thank you :)

The animation doesnt seem to exist (like you sugested), so im probably doing somthing else wrong in Blender.

If you fancy taking a look, i asked for help on a Blender forum:

http://blenderartists.org/forum/showthread.php?226055-Preparing-blender-files-for-exporting-to-unity...&p=1910839

Thank you for your help :)

avatar image Chris D · Jul 27, 2011 at 06:11 PM 0
Share

No problem, glad to be of assistance. If you mark this solution as accepted (check box next to the thumbs), others will know that you've found an answer and it may be of some help to someone in the future.

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

I got a major question 1 Answer

UNITY 3d 3.4 doesnt understand its own script? 5 Answers

Script won't run level (platformer tutorial) 1 Answer

JavaScript: ``Unknown Identifier`` 3 Answers

Can't compile script from Scripting Tutorial (translated to Boo) 3 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