Gamespace: PickUp Collectable Items
I created a way for my items (mini balls) to be picked up by my player. I also added a particle system so that when the balls were picked up, they almost 'exploded' making the Gamespace more interesting. My particle system before changing the values My particle system after changing the values This was the first 'PickUp' script that was used so that the player could collect the items. The ParticleSystem named 'particles', the Renderer named 'collectableItem' and the Vector3 named 'ball' were all made public so that they could be edited in the inspector. The function 'OnTriggerEnter' was used so that if something (the player) collided with the item, this function is triggered. The if statement states that if an object has the tag 'Player' and has collided with the item, the particle system will play (Particles.Play()), the components collider has been disenabled so that it cannot be picked up again, the ...