Hi, actually m facing some logical problem here… m calculating the reaction time when i start firing and hits target. m starting the StartUpTime when my camera collides with cube which is my first engagement with target. i have to find the time between camera collission with cube and 1st bullet hitting the target…
i have 5 bullets and m getting correct result when all 5 bullet hits target but if i hit 2 bullet to target and last 3 bullet to wall m getting reaction time value as 0, i know its logical mistake but m not getting any other idea, plz help
What object in the scene is this code attached to? Where do you declare your ReactionTime variable?
If you’re not getting a result if the last object hit is a wall, it seems like its being reset somehow each shot, so that unless you end with a hit on the target, the reaction time is never calculated. Don’t think we can tell without a bit more information.
Also, throw some code tags around your code to make it easier to read
i have an empty gameobject “Global” in my hierarchy to which m attaching my Bullet Script and SceneLogic Scritpt, when main camera collides with a cube which is placed at some distance in front of target, m calculating the StartupTime( StartupTime = Time.time) in SceneLogic Script. After the collission of camera with cube my 1st contact with “Target” starts and will start hitting towards “Target”, behind Target there is “Wall”. Now i have to calculate reaction time between camera collission with cube and 1st bullet hit…