the object of type 'gameobject' has been destroyed but you are still trying to access it

What is wrong ?

2335300–157787–BulletCubeBehaviour.cs (466 Bytes)
2335300–157788–CubeGunBehaviour.cs (2.51 KB)

are they the only two scripts you have in your project?

generally errors have line numbers, what line/script is the error referring to?

is your bullet in scene that you are instantiating or as prefab if its in scene i suggest you make it a prefab , because in scene the script thats the attached to the bullet which is bulletcubebehaviour will be destroy , where is in prefab it wont run the script.

1 Like