--Clicking the object Enables/Disables the Trail Renderer component on this object --[Add "trailrenderer" reference to the Scripting Runtime component]thisGameObject = Space.Host.ExecutingObjecttrailrenderer = Space.Host.GetReference("trailrenderer").TrailRendererOnClick=function()trailrenderer.Enabled =not trailrenderer.EnabledendthisGameObject.AddClickable()thisGameObject.Clickable.OnClick(OnClick)
--Make a UIToggle disable/enable the Receive Shadows feature of a Trail Renderer--[Add "toggle" and "trailrenderer" references to the Scripting Runtime component]thisGameObject = Space.Host.ExecutingObjecttoggle = Space.Host.GetReference("toggle").UIToggle trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderertoggle.IsOn = trailrenderer.ReceiveShadows --make toggle start at correct stateOVC=function()if toggle.IsOn then trailrenderer.ReceiveShadows =trueelse trailrenderer.ReceiveShadows =falseendendtoggle.OnValueChanged(OVC)
--Make a UIToggle disable/enable the Cast Shadows feature of a Trail Renderer--[Add "toggle" and "trailrenderer" references to the Scripting Runtime component]thisGameObject = Space.Host.ExecutingObjecttoggle = Space.Host.GetReference("toggle").UIToggle trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderertoggle.IsOn = trailrenderer.CastShadows --make toggle start at correct stateOVC=function()if toggle.IsOn then trailrenderer.CastShadows =trueelse trailrenderer.CastShadows =falseendendtoggle.OnValueChanged(OVC)
MotionVectors
bool MotionVectorsgetset
Set whether to use motion vectors to track this Renderer’s per-pixel, screen-space motion from one frame to the next. You can use this information to apply post-processing effects such as motion blur.
--Make a UIToggle disable/enable the Motion Vectors feature of a Trail Renderer--[Add "toggle" and "trailrenderer" references to the Scripting Runtime component]thisGameObject = Space.Host.ExecutingObjecttoggle = Space.Host.GetReference("toggle").UIToggle trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderertoggle.IsOn = trailrenderer.MotionVectors --make toggle start at correct stateOVC=function()if toggle.IsOn then trailrenderer.MotionVectors =trueelse trailrenderer.MotionVectors =falseendendtoggle.OnValueChanged(OVC)
--Make a UIToggle disable/enable the Light Probes feature of a Trail Renderer--[Add "toggle" and "trailrenderer" references to the Scripting Runtime component]thisGameObject = Space.Host.ExecutingObjecttoggle = Space.Host.GetReference("toggle").UIToggle trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderertoggle.IsOn = trailrenderer.UseLightProbes --make toggle start at correct stateOVC=function()if toggle.IsOn then trailrenderer.UseLightProbes =trueelse trailrenderer.UseLightProbes =falseendendtoggle.OnValueChanged(OVC)
Time
float Timegetset
How long does the trail take to fade out. (seconds)
Space.Host.ExecutingObject.TrailRenderer.Time =10
--Make a slider change the Trail Renderer's Time--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]thisGameObject = Space.Host.ExecutingObjectslider = Space.Host.GetReference("slider").UISlidertrailrenderer = Space.Host.GetReference("trailrenderer").TrailRendererOVC=function()trailrenderer.Time = slider.Value *10--0 to 10endslider.OnValueChanged(OVC)
StartWidth
float StartWidthgetset
The width of the trail at the spawning point. A width of 1 corresponds to 1 unit in the game world.
--Make a slider change the Trail Renderer's Start Width--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]thisGameObject = Space.Host.ExecutingObjectslider = Space.Host.GetReference("slider").UISlidertrailrenderer = Space.Host.GetReference("trailrenderer").TrailRendererOVC=function()trailrenderer.StartWidth = slider.Value *10--0 to 10endslider.OnValueChanged(OVC)
EndWidth
float EndWidthgetset
The width of the trail at the end of the trail. A width of 1 corresponds to 1 unit in the game world.
--Make a slider change the Trail Renderer's End Width--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]thisGameObject = Space.Host.ExecutingObjectslider = Space.Host.GetReference("slider").UISlidertrailrenderer = Space.Host.GetReference("trailrenderer").TrailRendererOVC=function()trailrenderer.EndWidth = slider.Value *10--0 to 10endslider.OnValueChanged(OVC)
WidthMultiplier
float WidthMultipliergetset
Set an overall multiplier that is applied to the TrailRenderer.widthCurve to get the final width of the trail.
--Make a slider change the Trail Renderer's Width Multiplier--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]thisGameObject = Space.Host.ExecutingObjectslider = Space.Host.GetReference("slider").UISlidertrailrenderer = Space.Host.GetReference("trailrenderer").TrailRendererOVC=function()trailrenderer.WidthMultiplier = slider.Value *10--0 to 10endslider.OnValueChanged(OVC)
--Make a UIToggle disable/enable the Autodestruct feature of a Trail Renderer--[Add "toggle" and "trailrenderer" references to the Scripting Runtime component]thisGameObject = Space.Host.ExecutingObjecttoggle = Space.Host.GetReference("toggle").UIToggle trailrenderer = Space.Host.GetReference("trailrenderer").TrailRenderertoggle.IsOn = trailrenderer.Autodestruct --make toggle start at correct stateOVC=function()if toggle.IsOn then trailrenderer.Autodestruct =trueelse trailrenderer.Autodestruct =falseendendtoggle.OnValueChanged(OVC)
NumCornerVertices
int NumCornerVerticesgetset
Set this to a value greater than 0, to get rounded corners between each segment of the trail.
--Make a slider change the Trail Renderer's Number of Corner Vertices--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]thisGameObject = Space.Host.ExecutingObjectslider = Space.Host.GetReference("slider").UISlidertrailrenderer = Space.Host.GetReference("trailrenderer").TrailRendererOVC=function()trailrenderer.NumCornerVertices = slider.Value *90--0 to 90endslider.OnValueChanged(OVC)
NumCapVertices
int NumCapVerticesgetset
Set this to a value greater than 0, to get rounded corners on each end of the trail.
--Make a slider change the Trail Renderer's Number of End Cap Vertices--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]thisGameObject = Space.Host.ExecutingObjectslider = Space.Host.GetReference("slider").UISlidertrailrenderer = Space.Host.GetReference("trailrenderer").TrailRendererOVC=function()trailrenderer.NumCapVertices = slider.Value *90--0 to 90endslider.OnValueChanged(OVC)
MinVertexDistance
float MinVertexDistancegetset
Set the minimum distance the trail can travel before a new vertex is added to it. Smaller values with give smoother trails, consisting of more vertices, but costing more performance.
--Make a slider change the Trail Renderer's Number of Mininum Vertex Distance--[Add "slider" and "trailrenderer" references to the Scripting Runtime component]thisGameObject = Space.Host.ExecutingObjectslider = Space.Host.GetReference("slider").UISlidertrailrenderer = Space.Host.GetReference("trailrenderer").TrailRendererOVC=function()trailrenderer.MinVertexDistance = slider.Value *10--0 to 10endslider.OnValueChanged(OVC)
TextureMode
int TextureModegetset
Choose whether the U coordinate of the trail texture is tiled or stretched. 0 Stretch, 1 Tile, 2 Distribute Per Segment, 3 Repeat Per Segment
--Clicking the object toggles between TrailRenderer's View or Transform Z alignment--[Add "trailrenderer" reference to the Scripting Runtime component]thisGameObject = Space.Host.ExecutingObjecttrailrenderer = Space.Host.GetReference("trailrenderer").TrailRendererOnClick=function()if trailrenderer.Alignment ==0then trailrenderer.Alignment =1else trailrenderer.Alignment =0endendthisGameObject.AddClickable()thisGameObject.Clickable.OnClick(OnClick)