playMaker

Author Topic: Need some Help With Create Object/Spawn  (Read 103 times)

apageeltd

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
Need some Help With Create Object/Spawn
« on: February 10, 2019, 03:38:25 PM »
I am Quite new to Playmaker.

So, i am trying to make a Shoot Em up game,

Ex:
Where i have Player health = 3, and everytime enemy shoots me Player subtracts 1 health and Eventually dies. Player health = 0

But after player dies, HOW TO I RESPAWN OR / RECREATE PLAYER ON THE SCENE WITH 3 LIFE,
Please help me in this issue please...
And details FSM graph or actions will be very much of help as me being very new to this


(Additional Help if Possible:Also how can i make player invinsible or untouchable of maybe 3 sec after it being recreated)


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 3812
    • View Profile
    • jinxtergames
Re: Need some Help With Create Object/Spawn
« Reply #1 on: February 10, 2019, 07:16:39 PM »
Hi.
There are different ways to achieve this and is depending on your setup.

You could set up a 'game manager' fsm. where you can set the game flow.

From the player fsm, when he dies, you can send an event to the 'game manager' that he died.

Then from the game mangaer you could pop up a menu with a restart button.

Then when player presses restart you can use for example a "Set Fsm Int" and set the player health back to 3

Untouchable also depend on your setup.

For example you can make a bool and call it "untouchable" then for the time that he can't get hit, set the bool to true. (you can do this from a different fsm by using "Set Fsm Bool")

When the player gets hit you should do a bool tests first an see if 'untouchable' is true or false.

if true, no damage if false do damage.

apageeltd

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
Re: Need some Help With Create Object/Spawn
« Reply #2 on: February 11, 2019, 07:00:45 AM »
Thanks for the reply, But as i said i am new to playmaker, So dont really know how to make/set game manager,,,,

also, i just want to create the player after the player dies on the same position,,,,,i have used prefabs also,,,,but player doesnot spawn


Athin

  • Junior Playmaker
  • **
  • Posts: 76
    • View Profile
Re: Need some Help With Create Object/Spawn
« Reply #3 on: February 11, 2019, 08:57:29 PM »
When he is talking about the "Game Manager" he is referring to just an empty game object in the scene.  You can create one and name it Game Manager (Or whatever you like) and throw an FSM on it.

Using the Send Event action, you can communicate between the player character and this manager.  Doing this for example you can then use the player to track its current health.  Once it drops below zero, it will then "Sent Event" "Death" to the game manger.  Now the game manager kicks in and does whatever you want to happen when they die while the player character does whatever you want as well.

This is all VERY depending on your set up but that can be a good start.

Let me know if you need more help/explaining.

apageeltd

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
Re: Need some Help With Create Object/Spawn
« Reply #4 on: February 12, 2019, 06:52:14 AM »
Dear athin, Thank you for the reply,,,, it makes sense to me now....But i will try it, and Sir if i face new issues .....i will bother you again for some help :-) please...
Thanks