Download

Score counter not accurate

I went through this great tutorial: https://www.youtube.com/watch?v=_CV_Sg3Ffw8. Everything works great except the counter not being accurate - as he mention at the end of the tutorial. And I can’t figure out why. Any help or suggestion will be appreciated. Thanks.

Not so great then! :wink:

Have a look at this spot:
https://youtu.be/_CV_Sg3Ffw8?t=309

And add points *before *you Delay. See if that helps.

Yeah, it’s so close and yet … :wink:

Do you mean like this? It doesn’t change the inaccuracy. Neither does decreasing the Delay Duration like one suggested on youtube. But maybe this method is limited in terms of accuracy?

Remove the delays altogether and test it then. Essentially, currently it’s possible to get points multiple times for the same target hit providing you fire faster than 5 times a second - which is not difficult at all.

If you want the delayed destruction, ensure the points are added only once - you can use a boolean + branch or DoOnce node for that. Something along the lines of:

It counts randomly even if I just hit the targets once. The ball/projectile continuous through the target on hit. Could this lead to some inaccuracy?

The above does not not seem to change anything.

Even when you do once as above? Btw, it’s not a great tut - there’s quite a number of shady practices, like UMG property binding with a cast inside, the liberal sprinkling of the Delay nodes would make debugging this a nightmare :expressionless:

Judging by the behaviour in the final seconds of the video, it’s the delay node that ruins it all. Do once should sort it out. In case it does not, do post a pic of your current setup that adds the points up.

You can probably make it work “*fine” *firing slowly.

Maybe I’m wiring it wrong?

​​​​​​​

Looks fine apart from the disconnected execution wire in the top pic. Out of curiosity, how many times does it print that text when a single projectile connects with the target?

It prints randomly from 1 - 5 lines on hit.

Then it’s something completely unrelated, hard to tell without seeing more script.

If you see more than one hit message when the projectile connects - perhaps the actors are accidentally stacked on top of each other? Judging by how they are spawned, it’s quite possible:

Every time a target spawns, there is 1/5 chance it will occupy a spot where another target already is…

The more I look at it, the worse the tut looks.

Are you after any specific mechanic or you’re just trying to replicate what the YT person did. If replication is what you’re after, you’re doing just fine. It’s just that examples and practises showcased there are quite far from the best.

No stacked actors.

Any suspicious wiring in Level Blueprint?

As mentioned above; this script **will **produce stacked actors. You have 5 possible spawn points. The event chooses 1 of 5 possible locations - there is a 20% percent chance it will choose the same one twice… and nothing stops it from choosing the same target point 10 times in a row.

You can change the Collision Handling on the spawn node - Try to Adjust, Don’t spawn…] if you do not want to create a smarter spawner. Not ideal but may work.

Well, I’m just after a simple and small game, shooting elves with a snowball gun. And with a score counter. I’ve done a lot of VR/visualisation stuff in UE and know my way around the graphic engine. But i’m such a noob when it comes to blue print. The tutorial - although a little old - seemed legit and easy.

Ah, that makes sense! But adjusting Collision Handling doesn’t change anything.

Collision Handling Override seems to work now! Changing Collisions Responses from Ignore to Block(and tick Generate Overlap Events)made the trick. I must admit I don’t know exactly why this is so. But maybe I will, further down the road :slight_smile:

Thanks, @Everynone!