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 Alecmac · May 14, 2015 at 11:42 AM · animationjavascript

Animations cant be seen?

I have an animation problem. I have a Character, a GUI Button and animations assigned to him. The idea is he walks in, then a timer starts where he stands around, if the button is not pressed by the time the timer runs out, then he exits. If the button is pushed then a different animation plays and everything resets to when he just came in.

There are no errors on the console, however I cannot see the model when I play the scene, however when I come out of the main camera I can see the animations playing?

Here is the Unityscript I am using.

// JavaScript var myTimer : float = 10; public var introAnimation : AnimationClip; public var waitingAnimation : AnimationClip; public var exitAnimation : AnimationClip; public var answerAnimation : AnimationClip;

function OnGUI () { //Text box GUI.Label ( new Rect (370, 500, 400, 30), "Ask A Question From The List Below");

              //Question 2 with box and response animation
           if (GUI.Button (Rect (500, 550, 150,30), "Why Are You Here?")) {
         //This code is executed when the Button is clicked
         animation.PlayQueued("Answer", QueueMode.CompleteOthers);
      }
                  //Starting animations
         animation.PlayQueued("Intro", QueueMode.PlayNow);
         
             //Waiting animations
                  animation.PlayQueued("Idle", QueueMode.CompleteOthers);
                      
                          //timer for waiting animations
                      if (myTimer > 0) {
                              myTimer -= Time.deltaTime;
                              }
                                  //when the timer ends, this animation plays
                                  if (myTimer <=0) {
                                  animation.PlayQueued("Exit", QueueMode.CompleteOthers);
                              }
                  

}

I need to be able to see the animations in the main camera. Please help!!

Comment
Add comment · Show 4
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 siaran · May 14, 2015 at 12:59 PM 0
Share

part of your code formatting went wrong...

anyway, if you cannot see animations, try playing just 1 animation on start or something and see if that one plays.

Also, I think a see a few things happening in OnGUI there that really should not be in OnGUI(). (You should really do UI things only in OnGUI())

avatar image Alecmac · May 14, 2015 at 01:58 PM 0
Share

All my animations work individually and even work when i play the scene in the scene view, just not the game view. What do you mean by not be in the OnGUI?

avatar image siaran · May 14, 2015 at 06:12 PM 0
Share

for example you update a timer in OnGUI, you should do that sort of thing in Update().

As for your question...

If you cannot see your character in the game view, is it located in front of the camera?

Put another way, what are the positions of your character and of your camera?

avatar image Alecmac · May 15, 2015 at 08:39 AM 0
Share

the idea is that the character walks into the view of the camera from the left, however to check it works i moved the camera to where the character starts. I can see the model and it tries to start the animation but then stops, like it glitching?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Alecmac · May 14, 2015 at 04:27 PM

I have tested each animation on thier own and they work (without using code) and they can be seen in the camera. When I put them into code is when it becomes invisible? As for the GUI i need an interactive button on screen that can be pressed, this would then play the answer animation before going back to the beginning of the Idle animation.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

how character's legs(tps) move? 0 Answers

How would you make a shapeshifting mechanic in a game? 1 Answer

How to fix Animation 1 Answer

Why isn't my animation being played? 0 Answers

Changing number of frames in uvAnimationTileX 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