[英]So my bullet prefab shows trail when dragged into the scene But not when I play it
So when in scene mode the bullet prefab shows the trails but when I hit the play button it doesn't show any trails whatsoever.因此,在场景模式下,子弹预制件会显示轨迹,但是当我按下播放按钮时,它不会显示任何轨迹。 I am trying to make a top down shooter with unity.
我正在努力制作一个具有统一性的自上而下的射手。 I am new to this, please help much appreciated.
我是新手,请帮助非常感谢。
While playing it doesn't show the trail播放时不显示轨迹
You can set the order of the trail renderer in Trail Renderer > Additional Settings > Order in Layer
.您可以在
Trail Renderer > Additional Settings > Order in Layer
轨迹渲染Trail Renderer > Additional Settings > Order in Layer
。
For an older version of Unity layer ordering variables are not exposed in the inspector.对于旧版本的 Unity 层排序变量不会在检查器中公开。 You can write a custom script that sets the sorting layer / order.
您可以编写一个自定义脚本来设置排序层/顺序。
public class RendererSortingLayer : MonoBehaviour
{
public string sortingLayerName;
public int sortingOrder;
void Awake()
{
Renderer renderer = this.GetComponent<Renderer>();
renderer.sortingLayerName = sortingLayerName;
renderer.sortingOrder = sortingOrder;
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.