Get 25% off your next order from the Unity Asset Store: YW86GYBU8S.
Forum begins after the advertisement:
[Part 5] Issue with lighting
Home › Forums › Video Game Tutorial Series › Creating a Metroidvania in Unity › [Part 5] Issue with lighting
- This topic has 1 reply, 3 voices, and was last updated 1 month, 3 weeks ago by
Ser Apustaja.
-
AuthorPosts
-
September 1, 2025 at 3:59 am #18783::
ok, so the video says to add something for the asset for lighting, but there are none.
View post on imgur.com
September 1, 2025 at 4:53 pm #18784::@Alp how do we add an asset to the Rendering Layers (3D) array in the Universal Render Pipeline asset?
September 1, 2025 at 5:00 pm #18785::To add an asset to the Rendering Layers (3D) array in the Universal Render Pipeline (URP) asset, you will typically follow these steps:
-
Locate the URP Asset: First, ensure you have your Universal Render Pipeline asset created in your project. You can find it in the Project window.
-
Select the URP Asset: Click on the URP asset to open its Inspector window.
-
Modify Rendering Layers:
- In the Inspector, look for the “Rendering” section. There should be an option for “Rendering Layers.”
- You will see an array where you can add or remove layers.
-
Add a Layer:
- To add a new layer, you can usually click a “+” button to add a new element to the array.
- Then, select or create the asset you want to add to this layer.
-
Save Changes: Make sure to save any changes you have made to the URP asset.
If you are working with code, you may need to modify the URP asset programmatically. Here’s a simple example:
using UnityEngine; using UnityEngine.Rendering.Universal; public class ModifyRenderingLayers : MonoBehaviour { public UniversalRenderPipelineAsset urpAsset; void Start() { if (urpAsset != null) { // Create a new layer LayerMask newLayer = LayerMask.GetMask("NewLayerName"); // Add the new layer to the Rendering Layers array int layerCount = urpAsset.renderingLayers.Length; System.Array.Resize(ref urpAsset.renderingLayers, layerCount + 1); urpAsset.renderingLayers[layerCount] = newLayer; // Save changes UnityEditor.EditorUtility.SetDirty(urpAsset); UnityEditor.AssetDatabase.SaveAssets(); } } }Make sure to replace
"NewLayerName"with the actual name of your layer. Also, this script should be run in the Unity Editor, as it usesUnityEditornamespace methods.Always remember to backup your project before making changes to URP settings or assets.
-
-
AuthorPosts
- You must be logged in to reply to this topic.
Advertisement below: