OK, how would you add points to score depending on hit location? Say you had a round archery target. The smallest center circle 100 points, the next biggest 75, the next 50, etc. I’ve learned how to detect a hit and add points to score by this video
Easy, each ring should be a different object and each set up to add a different score to the main score.
or use 1 mesh (triangle mesh) with multiple materials, use the detect material setting (I think it is available to collision and ray sensor but I am unsure)
Yeah, tried that. It’s detecting all the rings at once. I just came across this (
- Unless the Property field is set, the Ray sensor can detect objects “through” other objects (walls etc).
- Objects must have “Actor” enabled to be detected.)
I’m tying to figure out how to use the property field on the the ray sensor.
Dumb ? but how the heck you get material color to show up in Blender Game. I can’t seem to get it to detect the material, cause it doesn’t seem to be picking up the material color. The only way I can get a color to show is changing the object color.
Either the rings detect the arrows
or
the arrows detects rings
I would place the target’s origin at the center of the surface and use distance to determine score. The target would be 1 object with 1 material.
Assuming each ring is 0.1 units wide…
dist = target.getDistanceTo(hitpoint)
if dist < 0.1:
score = 100
elif dist < 0.2:
score = 75
elif dist < 0.3:
score = 50