Hello,I am new on unity.I have question I have a gun it’s firing ball’s.And I want when ball hit target add point in gui text.Can you help me ? I don’t where i gonna look… Thanks…
a) Add a ball collider to the bullet prefab.
b) Add proper colliders to the target game object. Try not to use complex mesh colliders but instead use combinations of primitive colliders for better performance.
c) Check the ‘is trigger’ option on the target’s colliders.
d) On your target’s script, implement a method ‘void OnTriggerEnter(collider c)’. Check if the param c corresponds to a bullet (you can use GameObject tag to category your GameObjects in the scene). If yes, destroy the bullet, and send message to your GUI script to add points.
Thank you so much,you give me an idea ontrigger enter so i made point system.