In my inputscript when the character press a skill I want to show the range and let the player choose where to place it and confirm with the mouse button.
My question is how should I detect that I am in the state after I have selected the skill and actually fire it?
I have added some pseudo-code of my attempt but I’m unsure how it will work, if the user press an ability and do nothing will all other scripts stop working and wait for this one to finish or anything like that? Its fine if only this script is affected for my game but it feels like there should be a better way to do this.
Update(){
if(input is a ability key){
while(true){
//display range and stuff
if(input is left mouse button){
//do some skill stuff
break;
}
if (input is right mouse button or ESC){
//do nothing
break;
}
}
}
}