0

I am building firest person Firearm Simulator. When i fire bullet hall prefab showing on the target board.

this is my target

enter image description here

when i fire enter image description here

Hole prefabs sticking on the target board like red rounds. i need to get a range of the holes. need to get measured the holes on 4Inch, 6inch or 10-inch rounds.

lulitha
  • 83
  • 11
  • You mean distance from the center? Place an object at the center of the target and get the distance between it and the holes. – Everts May 02 '19 at 07:48
  • thank you..mmm. nop. in the real world when firing there are steel rings(4inc, 6inc..). after fire instructor going to the target board and place the rings on the targets. if all ammo hits in 4-inch ring, it is 4inch firing, if not instructor place 6inch ring the all ammo in the 6inch ring it is a 6inch firing. that's what I need to do. any idea please? – lulitha May 02 '19 at 10:04
  • Find the geometric center and maximum distance from center – Draco18s no longer trusts SE May 02 '19 at 15:02

1 Answers1

0

First, you need to place a GameObject in the center of the target. Then you need to create a float variable for each circle that is equal to find how far away each circle is from the center. To do this, my suggestion is to copy and paste the center game object and move it to each circle on the x,y, or z axis and record how far away each circle is from the center. Once you have those numbers, you need to create an algorithm to find how far away the bullet is from the center. Finally, once you have how far away the bullet is from the center, develop a new algorithm to find between what circles the bullet is in. You will need to create an algorithm using if statements with greater than(>) and less than(<) values comparing the distance the bullet is from the center to the circles distance from the center to find what circles the bullet is between.

Brandalf
  • 476
  • 1
  • 6
  • 20