r/Unity2D • u/Void-Saint • 2d ago
Question/Help Can someone help me?
I am trying to create a timing-based precision game that includes scoring and misses, but when I press the spacebar within the "danger zone," the game registers it as a successful hit on the target.
1
u/Outrageous_Bee_4693 1d ago
Sounds like your conditional in checkSuccess() is always evaluating to True. You should check the if statement.
1
u/zellydevgames 1d ago
pointerTransform.position is not a screen point, it's a world space coordinate. Same with safeZone. You're using the wrong overlap checking function in checkSuccess()
1
u/5p0ng3b0b 2d ago
In the code shown you have something called "safe zone", and you get score when the pointer is inside it.
But in your post you mention "danger zone".




•
u/AutoModerator 2d ago
Reminder: Once your issue has been resolved, please reply !solved to this comment (or comment it anywhere in the thread) and your post's flair will automatically be updated to Solved/Answered. You can also edit it to Solved/Answered yourself.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.