C# - How can I load info about..

Hi.

[Android Game]

1.How can I check info about how much user touch(tap) the screen in 1 second?
2.How can I count current dmg in 1 second? ( Atack per second + atack per click )
3…How can I activate object for 1second when user touch te screen?

I have some code:

For 1:

Input.touchCount * time.deltaTime

For 2:

current_dmg = atack_per_second + Input.touchCount * atack_per_click;

For 3:

if ( Input.touchCount > 1 ) {

if ( Input.GetTouch ) {

object.SetActive(true);

}
}

1 - 2:
Think about them as units of measurement
In the first problem you probably want to keep a variable for taps and one for elapsed second, and then divide them
Update:
touches += Input.touchCount
secs += Time.deltaTime
touchPerSec = touches / secs
endUpdate

The second problem is probably per game tick, and you want dmg/sec, so you divide dmg with sec
int dps = dmg / deltaTime

3
You need a counter that is set to 1, whenever you tap and then each tick you remove elapsed time from it

if touched then
counter = 1
endif
if (counter >= 0)
counter -= deltaTime
else
counter = 0

Keep in mind, that I only gave you pseudocode, the implementation is up to you

That’s not answer for me. Please more. :slight_smile:

Yes, that is an answer for you, because a code that is written by someone who is not you will most likely break if you try to layer your code onto it. I wrote pretty self explanatory pseudocodes and on top of that I wrote some explanations too.

Noone’s going to write code for you, this forum is for helping, so you should write your code and if you fail you come here then you rewrite your code based on the suggestions, if you fail you come back again and so on

If you’re at it please check out unity network rules (https://forum.unity3d.com/threads/unity-developer-network-rules.151494/), especially “The do’s” 4 and 5