Cannot remove sprite using destroy

(This project is in 3D)

I used a sprite texture from the asset store to display points and I added it to a sprite gameObject. I call this object once the player goes through a box that gives these points. However, once the sprite is called it cannot be destroyed. This error pops up: “Destroying assets is not permitted to avoid data loss”

I couldn’t find any answers to this problem as most builds are already in 2D whilst I’m using 3D. I don’t know if that’s the problem, but if it is I would appreciate a way around this error. I hope I explained myself clearly and thank you for your time.

(Here is the code in javascript just in case it might help you. Once again, thank you)

(The sprite for the points is first in a light colour, then it turns darker. I did this by creating them in a different z axis and destroying one before the other.)

Is that you want to destroy the instantiated gameObject? If so, then you need to keep the reference of the instantiated object, so that you can destroy it later.

var clonedPointsSprite : Transform = Instantiate(PointsSprite, transform.position, transform.rotation);
GameMaster.currentScore += pointsNum;
Destroy(clonedPointsSprite.gameObject, 0.5f);
......