playMaker

Author Topic: Return to title screen on player death  (Read 365 times)

unearthly

  • Playmaker Newbie
  • *
  • Posts: 45
    • View Profile
Return to title screen on player death
« on: March 13, 2018, 11:31:30 PM »
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.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13001
  • Official Playmaker Support
    • View Profile
Re: Return to title screen on player death
« Reply #1 on: March 13, 2018, 11:57:04 PM »
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

unearthly

  • Playmaker Newbie
  • *
  • Posts: 45
    • View Profile
Re: Return to title screen on player death
« Reply #2 on: March 14, 2018, 09:43:25 AM »
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

unearthly

  • Playmaker Newbie
  • *
  • Posts: 45
    • View Profile
Re: Return to title screen on player death
« Reply #3 on: March 14, 2018, 11:18:46 AM »
Hi jeanfabre,

This tutorial showing a way to fade objects with Playmaker looks like a good way to do it https://www.youtube.com/watch?v=6WxC9-ihV0M

Regards Charles

krmko

  • Hero Member
  • *****
  • Posts: 638
    • View Profile
    • Fat Pug Studio
Re: Return to title screen on player death
« Reply #4 on: March 15, 2018, 02: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.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13001
  • Official Playmaker Support
    • View Profile
Re: Return to title screen on player death
« Reply #5 on: March 15, 2018, 11:11:35 AM »
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

unearthly

  • Playmaker Newbie
  • *
  • Posts: 45
    • View Profile
Re: Return to title screen on player death
« Reply #6 on: March 17, 2018, 04:39:04 PM »
Hi Jeanfabre,

If you could send me that example that would help.

Thanks regards Charles.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13001
  • Official Playmaker Support
    • View Profile
Re: Return to title screen on player death
« Reply #7 on: March 20, 2018, 03:32:11 AM »
Hi,

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



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