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 sten360 · Jun 05, 2014 at 09:59 AM · animatortriggerlagstutter

Stuttering and trigger issues after switching player sprite.

Hi,

My project is a 2D game and I decided to use the standard 2D player prefab from the Unity Assets Beta pack (found here: https://www.assetstore.unity3d.com/en/#!/content/14474) as it does exactly what I need so I figured there's no point writing my own character controllers etc. I've been using this as a placeholder for a while now but have now finalized my character design and went onto swapping the sprite. What I did was:

1) Remove the sprite renderer with the old sprite attached 2) Imported, sliced, and added my sprite in pieces as child objects to the Player object (like in the Unity 2D demo project) 3) Animated the child objects with keyframes using Animation and replaced the old animations with my new ones in the Animator.

Nothing else was changed. Everything seemed fine. My character was animating nicely, but here's where some weird problems started occuring...

1) My character sprite keeps lagging when moving. Previously, movement was beautiful and smooth, but now there is a constant stutter. It's not significant enough to break the game I guess, but bothers me as the whole reason I went for Unity animation instead of spritesheets was to make everything silky smooth.

I've narrowed the problem down to the animator. If I remove that, my character moves perfectly smooth (albeit without animation, obviously). I've checked my animations many times and they're smooth and I see no issue. If I remove all the animations from the animator, but leave it enabled, the character stutters again (albeit without animation, obviously). Therefore the problem has to be the animator. I searched around and info about this is very scarce, but from what I managed to gather there seems to be a problem with Rigidbody and animator interfering with each other? Unfortunately both are necessary for me, so removing one isn't an option... Following some suggestions, I have the rigidbody set on Interpolate and "Animate Physics" ticked on the animator, but no effect. I've messed around with other options too but nothing. I'm completely clueless about this.

2) Swapping the sprite has also caused issues with triggers for whatever reason. It makes absolutely no sense to me, as my triggers are based on tags and no tags have been changed at all. Everything was working fine before with the old sprite. My player object is tagged player and is on the player layer, and I've even set the child objects to be the same just in case. For some reason though, the player is never detected anymore by triggers, but normal collisions are fine. I've tried to add a sprite renderer and using a sprite on the main object along with the children, but nothing. Something is very weird here, it's literally the same object as before but not working anymore.

Okay since this is rather long I'll end it here. If any more information (or scripts?) are required, I'll gladly post them.

Any ideas as to what might be causing my problems are welcome. Thanks in advance!

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 sten360 · Jun 05, 2014 at 11:54 AM

Oh my god... I've just upgraded from Unity 4.3 to the new 4.5 and the stuttering issue seems to be fixed. I suppose it was a bug or somekind of inefficiency in the previous Unity code after all. So happy right now, haha.

Trigger issue still persists, though.

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

21 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity Animator Input Lag 0 Answers

How do I prevent an animation trigger parameter from activating while the animation it triggered is playing? 0 Answers

How to play animation from an array of gameObjects? 0 Answers

Repeat a Animation on the same GameObject? 1 Answer

Animations not transitioning properly 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