Help with variables not counting correctly with fast fast swipe

Hey all,

Just looking for some help. I have the code below for tools for my farming game but am having the issue of when I swipe with the tool too fast over the plots it isn’t counting all of the plots for example I have 9 plots but it will only count 7 or 8 at best. But it is changing all the other variables and the animations.

I have tried heaps of different things but had no luck.

If I understand it correctly, the plots animation changes, but are not necessarily counted? It’ll be because occasionally the collisions will be on 2 objects, and not 1, but you are only increasing the count by 1. Instead, increase the count by “PickedInstancesCount(Plot)”:

image

This will add the number of Water object that met the event conditions.

[Edit] Corrected the object being counted

So yeah the animation changes but I don’t think the tool variables are counting correctly. I will try that will that be the same situation for the harvest and seed tools when they go over too quick it doesn’t deduct the right amount of seeds and doesn’t count the right harvest amount?

Yes, it will be the same issue and can be fixed the same way.

What would the picked instances be for the harvest and the seeding? Sorry I haven’t played around with picked instances

Correction, it should be “PickedInstancesCount(Plot) ” for all the actions where the count is incremented:

image

I’ve updated my previous post.

1 Like

Should It look something like this now? Code will get cleaned up a bit lol. Just wondering what I need to change the conditions to as i have changed the actions?

Thank you for your assistance it’s highly appreciated

Ah, bugger. I totally misread your first screen shot, sorry. For some reason I read WaterCount as being a separate variable, not an object variable.

What I’d suggest instead that you put a repeat for each Plot as a first subevent, and then make the existing subevent a subevent off that.

For example, in the screenshot below, add a “Repeat for each Plot” before the red box, and move the red box event as a child of the repeat event.

Also, change the variable to increase by 1 - in the screen shot example it’s HarvestState variable.

Thankyou so much the repeat for each plot gay worked perfect