• 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
0
Question by TntManiak · Oct 06, 2016 at 03:48 PM · animationanimator2d game2d-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

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

76 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

Related Questions

Problem with Jump Animation 0 Answers

If you call yourself a game developer. Help 0 Answers

How do I stop an animation from looping? 1 Answer

Display cooldown timer 1 Answer

How to lower 2d animation? Right now it is floating in the air,How can I lower my sprite? I am having a player crouching, but right now it is floating in the air 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges