Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Error on visual scripting : Destroying assets is not permitted to avoid data lost

Discussion in 'Visual Scripting' started by youma64, Aug 20, 2022.

  1. youma64

    youma64

    Joined:
    Jun 30, 2022
    Posts:
    5
    On 2D game

    please help me :(


    A screenshot of the code :
    image_2022-08-20_184851867.png
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,517
  3. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,050
    Dekker is correct in that you're trying to destroy the prefab template instead of the object that you've instantiated.

    Use the Instantiate nodes output, which is the object you just instantiated and the cache it to a Graph variable with a Set Variable node. Then use Get Variable for Destroy node's input.