How do I make a C# script of a character holding a cube the shoots any sandbox piece that appears in the ground? Then shoot again in a different spot of the ground? When you shoot the second time the first ghost shape is gone then the second one appears to let players know you switch spots before instantiating.
Then move the sandbox piece with the Numpad. I already know how to make sandbox pieces move with the Numpad then instantiate. But I have no idea how to switch to a newer ghost shape when shooting in the ground before instantiating. And the old ghost shape is deleted when switching spots by shooting the ground many times.
Also make a Undo and hammer script to delete the shape that was mistakenly instantiated?