How to pick up gems using a object?

I trying to make a game in space you’s a flying car yeah and go through a spiral. And i need help with. How can i make the object collect the gems… the starts

Thanks please help …

1 Answer

1

You need to detect collisions with the gem Collider and the car Collider and then do something in the OnCollisionEnter() function such as increase score etc., then Destroy() the gem to remove it (or set the Renderer.enabled to false, whatever works better for you).

I would suggest reading the docs for the Collider class here