Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: unearthly on March 14, 2018, 02:31:30 AM

Title: Return to title screen on player death
Post by: unearthly on March 14, 2018, 02:31:30 AM
Hi guys, wondering if you can help me with a minor problem.

I have a return to title screen option working with a key press, but when used to load the title screen after the players death there's a graphical problem. At the players death the screen fades to black before returning to the title screen level,.. but between them a view of the game world reappears for a second. It's that image I don't want appearing.
Title: Re: Return to title screen on player death
Post by: jeanfabre on March 14, 2018, 02:57:04 AM
Hi,

 you need to also include a fading on your level.

 so your level as a canvas with a black image by default, and you fade this fade automatically when the level starts.

 this way you avoid this kind of issues.

also, I suggest you move away from the action fade as it uses the old UI, instead you could make a dedicated canvas with just the fade image in full screen and make that canvas persistent in your game, and survive loading which would have the same effect. and you can reuse this everywhere you need a fading.

 Bye,

 Jean
Title: Re: Return to title screen on player death
Post by: unearthly on March 14, 2018, 12:43:25 PM
Hi jeanfabre,

Not sure how to fade the black image on canvas. Are we talking about a sprite animation or a way to use actions to control alpha on a material or something else? :-[

Regards Charles
Title: Re: Return to title screen on player death
Post by: unearthly on March 14, 2018, 02:18:46 PM
Hi jeanfabre,

This tutorial showing a way to fade objects with Playmaker looks like a good way to do it
Regards Charles
Title: Re: Return to title screen on player death
Post by: Fat Pug Studio on March 15, 2018, 05:28:53 AM
You can just stretch a single black pixel over the whole screen and change it's alpha in spriterenderer to fade, simple as that.
Title: Re: Return to title screen on player death
Post by: jeanfabre on March 15, 2018, 02:11:35 PM
Hi,

 No need for a single pixeled texture or sprite to achieve this:)

 create a UI Image, with no sprite, set it to black color and stretch it to full screen, and that's it, animate the color value then.

 else, add a CanvasGroup and animate the alpha value if you want a cleaner value for fading.

If you need a quick sample, I'll provide.

Bye,

 Jean
Title: Re: Return to title screen on player death
Post by: unearthly on March 17, 2018, 07:39:04 PM
Hi Jeanfabre,

If you could send me that example that would help.

Thanks regards Charles.
Title: Re: Return to title screen on player death
Post by: jeanfabre on March 20, 2018, 06:32:11 AM
Hi,

 ok, New sample on the Ecosystem showing how to do a fade system:

(https://i.imgur.com/wprakYA.png)

it comes as a prefab, so you can drag it on your scene straight away. Check the fade canvas order index, but it's set to 100, so hopefully you don't have 100th of canvas, else raise that to the maximum  so that it's always on top.

Let me know if it works for you and if it make sense.

 Bye,

 Jean