|
| 05 Sep 2016 02:16 PM |
Assuming I'm lerping the default character joints, how would I create some sort of priority system? I tried a bunch of if statements to override animations and it ended up being 400+ lines for two animations. I need some way to make animations overlap each other. Such as walk animations get overridden by jump, but jump gets overridden by climb or swim, etc.
I can C-Sharply, can you? |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2016 02:18 PM |
| ################################################## |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2016 03:18 PM |
bump
I can C-Sharply, can you? |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2016 03:26 PM |
I would have the animations as functions, and these functions set a "priority" variable depending on their priority
so for example, if walking animation is 2 priority and jumping is 3, when the jumping function animation is called, it changes the var value to 3
the walking animation loop uses an if statement to see if the current priority is higher than it's priority, and returns the function (to end it) |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2016 03:27 PM |
@Aggressive
Could you show me an example? :(
I can C-Sharply, can you? |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2016 03:30 PM |
local priority = 0
function walkanimation () --2 priority if priority > 2 then return nil end priority = 2 while priority <= 2 then --animate wait() end end
function jumpanimation() --3 priority if priority > 3 then return nil end priority = 3 while priority <= 3 then --animate wait() end end
something like that |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2016 03:32 PM |
Okay thanks.
I can C-Sharply, can you? |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2016 03:33 PM |
an issue with that script is when an animation is done, the priority level will stay high
at the end of the function you could set priority to 0 so the next highest animation would take over |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2016 03:34 PM |
Danks fam.
I can C-Sharply, can you? |
|
|
| Report Abuse |
|
|