Question is off-topic or not relevant
how to cancel all other action while combat or dash?
for example i have movement C and attack A and dash B . allow A or B only when C and when A do not allow B and C and etc. i want player to do dash or attack only while idle or move and cancel everything other when attack or dash, until it's finished. please help
Answer by attikitten · May 02, 2020 at 06:35 AM
Something you can try to do is set up bools at the beginning of the method to check if they are dashing or are in combat to limit when they can attack.
private void AttackOne(){
if(dashing) // if dashing is true
return; // exit out of method
inCombat = true;
// so basically if dashing is false then you can do any of the logic below
// put logic for combat
// either use a timer to tell when inCombat= false or use it in an animation key frame event }
private void Dash(){
if(inCombat) // if in combat is true
return; // exit out of the method
dash = true;
// so basically if incombat is false then you can do any of the logic below
// put logic for dashing
// either use a timer to tell when dash = false or use it in an animation key frame event
}
You can basically just control how they get into actions that way and you can do that for as many things as you need like idle, jumping, movement, anything.
Follow this Question
Related Questions
Object movement algorithm 0 Answers
How to make an object move, not teleport? 0 Answers
Detect all object are touching as one cluster 0 Answers
Trying to get camera to follow mouse, and player movement to be relative to camera angle? 0 Answers
How to use hold/tap interactions in new Input System 0 Answers