Build Erro with Laser Pointer
Hello, I've created a laser system to select objects, the laser script creates the line renderer component, too configure it, and create and applie one new material. When debugging in own unity everything works correctly but after compiling (build) the project the component is created but without properties and without material. Can you guide me how to solve this problem ?. Attached reference print screen.
LineRenderer lineRenderer = gameObject.AddComponent(); lineRenderer.material = new Material(Shader.Find("Particles/Priority Additive (Soft)")); lineRenderer.startColor = CorLaser; lineRenderer.endColor = CorLaser; lineRenderer.startWidth = LarguraInicial; lineRenderer.endWidth = LarguraFinal; lineRenderer.positionCount = 2;
lineRenderer.enabled = !condicao;
LuzColisao.GetComponent<Light>().enabled = !condicao;
Answer by SNC-LAVALIN · Jul 01, 2019 at 04:59 PM
257/5000 Sorry! already discovered the problem is in the "Particles / Priority Additive (Soft)" shader. In unity works correctly but after builded, for some reason, can not create the material with this shader, I created "Particles / Priority Additive" and it worked correctly.
Your answer
Follow this Question
Related Questions
How to set a bool from a script equal to another bool from another script? 1 Answer
How to make a Laser projector like shown. 1 Answer
Problem with Reflecting Laser (RaycastHit2D and Line Renderer) 0 Answers
Bouncing laser, wierd flickering 0 Answers
How to shoot a laser beam in a 2.5d game 0 Answers