I’ve tried everything i can think of so far so I’m praying someone knows a fix for this.
So I’ve made a Find Closest Script and it manages to figure out the closest circles to the button pressers at all times which is great! The issue is in the PreEmptiveClick, where if you press too early its supposed to recognize the closest circle and destroy it (so you cant click it to get hp back), reset hit combo, and do damage to the player.
So far it does all of the above almost perfect. It resets your combo, player takes damage and it deletes the objects. Here is the problem “Objects” It literally deletes all objects instead of the one missed and to top it off the player takes damage no matter if they clicked in time or not. I assume this comes from the fact there’s still notes over the threshold of transform.position.y >= 80.
I put a variation of my PreEmptiveClick that i tried however much like the first it was without any luck, Object hits even get deleted as it cannot differentiate between the notes above the threshold and those that its actually supposed to care about
I have a Game Reference picture as well where you can see it draw the lines to the closest one but I’m just not sure on how to make it count for it
Please help, let me know if more pictures are needed!
Find closest is attached to the buttons at the bottom (the pressers) so they can get the closest circle. PreEmptiveClick is within the Hit Circle Object script which is attached to the Hit Circles that comes into the botton presser
I don’t actually understand how your code is supposed to work. Each of your “presser” objects (I don’t know what that means) is finding the closest circle to themselves but you never actually use that information anywhere as far as I can tell.
Your PreEmptiveClick is checking whether you press a certain key on the key board. Then it does a getComponent() on itself? I thought you said that findClosest was on the “presser” object and that PreEmptiveClick was on the hit circle, so how will get Component ever find anything?
So i took a step back and looked on it after you mentioned it, moved it over to the button presser so now i guess i just have to reference the object to destroy which would be the Hit Circle Object if i’m not wrong, going to take a look at that tomorrow though, thanks for the pointers so far