Search Unity

Simple Decals not appearing at runtime

Discussion in 'Editor & General Support' started by whidzee, Oct 27, 2019.

  1. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    166
    I have downloaded the Simple Decals System https://assetstore.unity.com/packages/tools/particles-effects/simple-decal-system-13889

    It does not seem to work at runtime, in the editor my decals look great, but nothing when i hit play.

    Going through the comments I see that @unity_4IOhqkA32olzpg has offered some code to get it all working, but i am getting an error in his code

    Assets\Decal_Script.cs(41,32): error CS1503: Argument 1: cannot convert from 'Decal' to 'DecalSystem.Decal'

    I see that @Lone-Developer has had luck by saying it needed a simple code adjustment, but no mention of what that code adjustment is.

    Has anyone had any luck with this decal system? Any help would be greatly apprecaited
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please describe how you are run time debugging, and provide the code that you refer to. And what comments?
     
  3. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    166
    in runtime when i look at my asset which is to have decals on it they are not there. I'm not sure of a way to debug it other than visually. The decals look fine in the editor. They are not visible in the prefab editor(I have attached the decals inside a prefab)

    The code provided in the comments of the Simple Decals System is this

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using DecalSystem;
    5.  
    6. public class Decal_Script : MonoBehaviour
    7. {
    8.     public GameObject ThisDecal;
    9.  
    10.     // Start is called before the first frame update
    11.     void Start()
    12.     {
    13.  
    14.         CreatePrefab();
    15.  
    16.     }
    17.  
    18.     // Update is called once per frame
    19.     void Update()
    20.     {
    21.  
    22.     }
    23.  
    24.     void CreatePrefab()
    25.     {
    26.         // instantiate decal
    27.  
    28.         GameObject obj = Instantiate(ThisDecal, ThisDecal.transform.position, ThisDecal.transform.rotation);
    29.  
    30.         //decal implementation!!
    31.         var decal = obj.GetComponent<Decal>();
    32.         if (decal) //if this obj has decal script
    33.         {
    34.             var filter = decal.GetComponent<MeshFilter>();
    35.             var mesh = filter.mesh;
    36.             if (mesh != null)
    37.             {
    38.                 mesh.name = "DecalMesh";
    39.                 filter.mesh = mesh;
    40.             }
    41.             DecalBuilder.Build(decal); //THE ERROR IS HAPPENING HERE
    42.  
    43.         }
    44.  
    45.     }
    46. }
     
    Last edited: Oct 27, 2019
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  5. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    166
    thanks for that. it's seeming that this code is set to be in the Editor folder, so this is likely why it's only showing up in the editor. @nickgirga seemed to get it working. I wonder if he could share what he did on that?
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    He could share if he chooses to and is reading this (?), I would not know of course. Does the asset have any examples? Are they working? Have you contacted the developer directly?
     
  7. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    166
    there doesn't appear to be any support option from the developer
     
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, I see a link to their support website, and then a Connect button.