Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

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:
    31,233
  3. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    1,033
    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.