playMaker

Author Topic: Repawn system in playmaker  (Read 6916 times)

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Repawn system in playmaker
« on: December 08, 2014, 11:23:47 PM »
How can I set up a item that collides with the player to spawn back to a empty object that is generated after the players death?

For example, player falling off of a platform or cliff hitting that object that causes death.

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Repawn system in playmaker
« Reply #1 on: December 08, 2014, 11:30:09 PM »
You could tag the object as "Death" then check every frame if the player has collided with a collider with the tag of "Death"

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Repawn system in playmaker
« Reply #2 on: December 08, 2014, 11:41:47 PM »
You could tag the object as "Death" then check every frame if the player has collided with a collider with the tag of "Death"

What would that mean for the players tag? Plus what ever states would be needed for the object as well as for the player?

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Repawn system in playmaker
« Reply #3 on: December 08, 2014, 11:47:42 PM »
Collision Event action is what you're after, put this on the player and detect collision enter with the tag or 'Death'. When the player hits a collider with the tag death it can then send an event which would kill the player.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Repawn system in playmaker
« Reply #4 on: December 09, 2014, 10:38:50 PM »
Collision Event action is what you're after, put this on the player and detect collision enter with the tag or 'Death'. When the player hits a collider with the tag death it can then send an event which would kill the player.

With only that action? I tagged a object with that type of tag, but I don't know what other action to but after that one. Isn't there a action besides Get Position that would solve this problem regarding how a player would respawn? Because when I add that action, I can't set up a empty object on it or at least on the vector section.
« Last Edit: December 09, 2014, 10:44:20 PM by coffeeANDsoda »

Merto

  • Playmaker Newbie
  • *
  • Posts: 20
Re: Repawn system in playmaker
« Reply #5 on: December 10, 2014, 09:06:11 AM »
A simple respawn can be done by using the Set Position action and making that set the position where the character is going to respawn after a collision with a deadly object. You can enter the place you want your character to respawn at in the XYZ controls of the Set Position action.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Repawn system in playmaker
« Reply #6 on: December 10, 2014, 03:10:19 PM »
You can enter the place you want your character to respawn at in the XYZ controls of the Set Position action.

Without using a empty object that would spawn at the previous platform?

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Repawn system in playmaker
« Reply #7 on: December 10, 2014, 04:01:15 PM »
Just to clarify what exactly you want - player falls from platform A and hits spikes and dies, you want to respawn back at platform A. You're after a way to store platform A's position so you can respawn at that position?

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Repawn system in playmaker
« Reply #8 on: December 10, 2014, 08:32:58 PM »
Just to clarify what exactly you want - player falls from platform A and hits spikes and dies, you want to respawn back at platform A. You're after a way to store platform A's position so you can respawn at that position?

But have it work on any platform that the player falls from. Therefore, when the player falls, they collide with a tagged object that kills them.

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Repawn system in playmaker
« Reply #9 on: December 10, 2014, 08:51:56 PM »
One way you could do this is ray cast down when the player lands on a platform and store that platform as the respawn platform. How do you know when a player lands you ask? when you jump you could raycast down and get the distance to the platform, when this ... lets say less than 0.01 units the player has landed.

Hope that helps

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Repawn system in playmaker
« Reply #10 on: December 10, 2014, 09:15:38 PM »
What I don't understand is if I use a raycast in another state after triggering a event or collision event, what would that mean for an additional action to reset the players position on a platform?
« Last Edit: December 10, 2014, 09:18:37 PM by coffeeANDsoda »

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Repawn system in playmaker
« Reply #11 on: December 11, 2014, 04:13:36 AM »
I don't understand..

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Repawn system in playmaker
« Reply #12 on: December 11, 2014, 04:25:14 AM »
Correct me if I'm wrong, but you did say in your previous post that I would have to use a raycast on the players fsm right? Not the death cube that is tagged?

I said that because the player has 1 FSM while another FSM cube is added to the bottom of the player in order to detect platforms while jumping like in this video below.






« Last Edit: December 11, 2014, 04:31:35 AM by coffeeANDsoda »

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Repawn system in playmaker
« Reply #13 on: December 11, 2014, 04:53:56 AM »
Ah yep, you could store the collider in the hitSomething state (from the tutorial) this would give you your platform to spawn from. BUT that won't give you a position to actually spawn. 

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Repawn system in playmaker
« Reply #14 on: December 17, 2014, 03:04:48 AM »
Ah yep, you could store the collider in the hitSomething state (from the tutorial) this would give you your platform to spawn from. BUT that won't give you a position to actually spawn.

Awhile ago, I checked out this video.


I tried that, but whenever I started the game, it would be directly to the COLLISION START global transition event.