x


Animations and how to determine the lenght?

I am working with C# So to give you the context, I am having this character, that has a hit animation, I have set it so that while the hit animation is playing, a boolean makes sure that the character can deal damage. However, I have now come to the conclution, that I do not want the character to be able to deal damage during the entire animation, but only in a part of it. I am currently trying to solve it with a corutine waitforseconds, but first of all, it is pretty hard to make sure that it waits for the correct amount of time before enabling the damage boolean, second it really dosent feel right, and is kinda clumsy. Does anyone have a suggestion on how to solve this problem?

more ▼

asked Oct 07 '10 at 01:06 PM

Tabu gravatar image

Tabu
176 23 26 38

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first
animation["Attack"].length;

I think what we do on the game I'm currently working on is that we set up an 'attack' script which has all of the information on a particular attack -- damage, animation speed, range, and damage point, then we manually yield for seconds on the damage point. It takes some tweaking to get it right, but you only need to get it right once more or less.

Alternatively, you could use physics to detect collisions and deal the damage at that point.

more ▼

answered Oct 07 '10 at 02:14 PM

Adam Rademacher gravatar image

Adam Rademacher
1.1k 1 3 19

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3790
x572

asked: Oct 07 '10 at 01:06 PM

Seen: 525 times

Last Updated: Oct 07 '10 at 01:06 PM