Report this content
We want the Dreams coMmunity to be a safe, diverse and tolerant place for everyone, no matter their age, gender, race, sexual orientation or otherwise. If you believe this content to contradict these principles, you can file a report for our coMmunity teams to investigate.
Note that misuse of the reporting tool will not be tolerated.Item being reported:
How do you detect when a button has been released?
For example, pressing R2 does a pull back punch anim and then releasing R2 does the punch attack anim. If you were to hold it down it would hold the pull back anim until you release R2.
I tried the following but it seemed overly complicated and has bugs...
I have a microchip that received the R2 press. That goes into a "greater than 0" calculator which goes to a counter. When the counter equals 1* it turns on a timeline with the pull back anim and when that completes it turns on a second counter which activates a single keyframe with the final pose of animation from the timeline. This is so if you hold the button it holds the pose.
*Now, when the first counter equals 1 it's also turning on another calculator that detects when R2 equals 0. When this is on and it then equals 0, the punch anim plays and should run out and revert to the default standing pose.
The problem is if you release R2 during the pull back anim timeline it will play the punch anim but also finish the pull back anim which activates the final frame pose so ultimately the character gets stuck in the pull back pose.
Hopefully that all makes sense!
So, is this an overly complicated way of detecting a button release?
And also how would I interrupt a timeline? When that second "equals 0" calc activates it triggers the power on the first timeline. But I can't tell if this is toggling the power or turning it on or off. I think what I'd like is a definite way to tell something to turn off immediately. Or on.
Any thoughts much appreciated!