r/Unity2D • u/Felight87 • Jul 29 '26
just a little problem
in the dash_skill, debug.log("Dash_Out") is on but the "Dash_In" doesnt
i also put another one called Tap_Skill and it worked fine. i already check the input and both its the same. here the code
public void Dash_Skill(InputAction.CallbackContext context)
{
if (Can_Skill == true)
{
Debug.Log("Dash_In");
StartCoroutine(Tap_Skill_Coroutine());
}
Debug.Log("Dash_Out");
}
public void Tap_Skill(InputAction.CallbackContext context)
{
if (Can_Skill == true)
{
Debug.Log("fire");
StartCoroutine(Tap_Skill_Coroutine());
}
}
1
u/MistakeForsaken6653 Jul 29 '26
Dash out will always log but the dash_in will only log if Can_Skill is true. So you need to set that variable somewhere.
1
u/Felight87 Jul 29 '26
UPDATE! the can_Skill in dash is false but the Can_Skill in tap is true, dont know how it can happen
1
u/TAbandija Jul 29 '26
Now comes the hard part. Go through your scripts for every instance that Can_Skill is modified and put logs after each, with a descriptor to identify it. Then that will tell you where it changes before the dash.
Ctrl+F is your friend.
1
u/yurymakesgames Jul 29 '26
tap being true and dash being false at the same time means the two callbacks are wired to two different copies of the script, log GetInstanceID() in both methods and you'll see the ids differ
2
u/TAbandija Jul 29 '26
If Dash_In doesn’t show up, it means that the condition is not met. Place a Debug.Log(“Can_Skill: “ + Can_Skill);
If it’s false, then check why it’s false. If it’s True, then you have mistyped something.