HScript goofy #537
-
it seems as though cne isn't recognizing onDadHit and onNoteHit in my character's hx file ( var blinkTimer:Float = 0;
var ranVal:Float = 0;
var allowBlink:Bool = true;
var allowTimer:FlxTimer = new FlxTimer();
function onDadHit(event:NoteHitEvent) {
trace("kill me please"); // this line is for debug (it didnd't print)
allowBlink = false;
trace('no way hosea');
allowTimer.stop();
allowTimer.start((event.note.isSustainNote) ? event.note.sustainLength : 1.0, () -> {allowBlink = true;});
}
function onNoteHit(event:NoteHitEvent) { // this is for debug (it didn't print)
trace("PLEASE BRO");
}
function update(elapsed:Float) {
blinkTimer += elapsed;
if (blinkTimer >= 1 / 6) { // fake fps
blinkTimer = 0;
if (allowBlink) {
ranVal = Math.random();
trace("Value: " + ranVal);
if (ranVal < 0.05) {
animation.play("blink");
}
}
}
} Did NoteHitEvent get publicly executed during my month-long hiatus and nobody told me? Or is there some alternative explication (explanation)? |
Beta Was this translation helpful? Give feedback.
Answered by
Moro-Maniac
Jan 31, 2025
Replies: 1 comment 6 replies
-
I'm pretty sure character scripts don't have access to the noteHit functions. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just check if the currently playing animation is the idle. If it is, do the plinking shit.