Keywords: Unity, Solution for common issues

failed to open source file: ‘Packages/com.unity.render-pipelines.xxx’

Error at compiling assets:

Shader error in 'XXX': failed to open source file: 'Packages/com.unity.render-pipelines.lightweight/ShaderLibrary/Core.hlsl' at line 72 (on d3d11)

Reason:
Render pipelines was missed in project, e.g. you created a project using 3D template.

Solution:
Create a project using LWRP template or High Definition RP template, these two templates provided new render pipelines.

Reference:
[LWRP] UPGRADING LWRP PACKAGE TO 7.0.0 BREAKS FORWARDRENDERDATA ASSET IN RESOURCE FILES
https://issuetracker.unity3d.com/issues/lwrp-upgrading-lwrp-package-to-7-dot-0-0-breaks-forwardrenderdata-asset-in-resource-files

Assets go pink

Issue:
Assets in scene go pink (purple).

Reason:
1, Materias and shaders of assets were missed.
2, Materias and shaders of assets using old render pipeline which not support in new verson.

Solution:
Retarget materias and shaders in meshes or update materials and shaders.

Reference:
everything became pink
https://answers.unity.com/questions/168624/everything-became-pink.html

Error CS0246: The type or namespace name ‘float2’ could not be found

Error at building project

error CS0246: The type or namespace name 'float2' could not be found (are you missing a using directive or an assembly reference?)

Caused by:
Missing requisite package.

Solution:
Install Mathematics: Windows -> Package Manager -> Select Mathematics and click Install.


It is not a lack of love, but a lack of friendship that makes unhappy marriages. ― Friedrich Nietzsche, Twilight of the Idols