Playmaker Forum

PlayMaker Updates & Downloads => Share New Actions => Topic started by: Thore on September 06, 2018, 07:38:13 PM

Title: Sprite / SetOrderInLayer
Post by: Thore on September 06, 2018, 07:38:13 PM
SetOrderInLayer.cs
Gets the SpriteRenderer of suitable GameObject, and sets the "Order in Layer" property to an integer you provide.

Purpose
In 2D games with a camera set to orthographic projection, the Z axis is ignored. The layers are used to roughly sort what is background, foreground etc. But within those layers, you use order in layer to determine what is in front of something else. With this action, you can change that order.

Example
In my case, a character carries a weapon on their back. When the weapon is drawn, it needs to change order in layer so it's drawn in front of the character.
Title: Re: Sprite / SetOrderInLayer
Post by: Fat Pug Studio on September 07, 2018, 02:47:02 AM
Excellent, thanks!
Title: Re: Sprite / SetOrderInLayer
Post by: PlaymakerNOOB on September 07, 2018, 07:22:23 AM
Awesome thanks!