• 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 /
  • Help Room /
avatar image
1
Question by TntManiak · Oct 06, 2016 at 03:48 PM · animation2d gameanimator2d-platformer2d animation

Increase attack speed and animations

Hello,

I make a 2D beat'em up and I need your help for an issue I'm running about a gameplay feature.

The player have a skill which increase attack speed by 80%. So I have to do:

  • Increase attack speed by 80% which mean decreasing "attack duration" by 80%

  • Increase animation speed by 80%

I have a member variable called "attackDuration". In normal time, attackDuration = 1.5f. In normal time, my attack animation fit perfectly the attackDuration (`animator.speed = 1.0f`).

With the attack speed buff, the attackDuration fall to 0.3f. In the same time, I set the animator speed to 1.8f. But for what I can see, my animation does not fit at all to my attack duration.

Is there a problem with animator.speed? Someone running the same issue?

Thank you

EDIT: I logged the animation clip length:

  • Animator.speed = 1f => lenght = 1.5 sec

  • Animator.speed = 1.8f (+80%) => length = 0.8 sec

And for my attackduration:

  • Attackduration (normal time): 1.5 sec

  • Attackduration (+80% speed == multiplied by 0.2): 0.3 sec

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 Kakoha · Dec 19, 2021 at 11:25 AM

It's so sad to see that this question wasn't answered for more than 5 years. I have the same problem and I still have no idea how to solve it :( If I find a solution I'll come back and write it here for future viewers !

Comment
Add comment · Show 1 · 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 Kakoha · Dec 23, 2021 at 02:05 PM 1
Share

btw I fixed this two days ago. the problem is about the smooth transition that unity makes between animation. you can either make the next animation also fast, or remove the smooth transition. you can remove the smooth transition by clicking on the transition arrow and narrowing the blue thing down.

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

77 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 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 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 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

If you call yourself a game developer. Help 0 Answers

Problem with Jump Animation 0 Answers

How do I stop an animation from looping? 1 Answer

What's the best way to set up an animator controller for a character that can look up, down, or sideways? 1 Answer

Animation Script on GetKeyPressed 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