playMaker

Author Topic: 2D Physics Based Platformer Tutorial  (Read 82314 times)

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: 2D Physics Based Platformer Tutorial
« Reply #105 on: December 28, 2014, 03:59:44 PM »
Plus, when I set up the death trigger with a local vector3, what would that mean for sending a event to the respawn, since I would have to send a event with a game object specified right?

The issue I have here before setting up the respawn is it will only let me send the player to that spawn trigger if it has a global event. And I don't know if I should make a new FSM for the player since I don't know how that would work with the other scripts, after all the player doesn't have global events on either movement or jumping FSMs.

cloud03

  • Full Member
  • ***
  • Posts: 249
  • Viva Playmaker!
    • Milkish Game Studios Blog
Re: 2D Physics Based Platformer Tutorial
« Reply #106 on: December 28, 2014, 09:21:13 PM »
For sticking issue, apply that material to the player, not to the ground or any other object.

And for respawn issue, I'd suggest to watch basic playmaker tutorial, and also tutorial dealing with variable and sending event. Most of the tutorial already covered basic concept for working between object, and it would be easier once you grasp the concept behind playmaker.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: 2D Physics Based Platformer Tutorial
« Reply #107 on: December 28, 2014, 09:33:51 PM »
What kind of basic tutorials are you referring to? Don't recall the basic game design series going into detail when a person applies similar concepts to a spawning system that spawns the player spending where that point or trigger is located, like a check point system or something. 
« Last Edit: December 29, 2014, 01:32:56 AM by coffeeANDsoda »

cloud03

  • Full Member
  • ***
  • Posts: 249
  • Viva Playmaker!
    • Milkish Game Studios Blog
Re: 2D Physics Based Platformer Tutorial
« Reply #108 on: December 30, 2014, 02:32:14 AM »
the one on hutonggames channel, and also basic logics behind programming, I found most of the unity introduction scripting are quite good. A bit scripting knowledge is useful when using Playmaker.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: 2D Physics Based Platformer Tutorial
« Reply #109 on: December 30, 2014, 02:56:43 AM »
If you were referring to global variables like in the puzzle quest tutorial on hutonggames channel, don't understand how this would apply to using a single instant death object being capable to trigger other objects that respawns the player if each them have different locations.

Just seems to me that it would make more sense if each spawn trigger had a different death collision object representing different positions, given that it wouldn't make sense to add the same value for X,Y,Z on a global variable. So if I used a vector3 with the position value on each axis it would have to be local.




coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: 2D Physics Based Platformer Tutorial
« Reply #110 on: January 02, 2015, 04:41:26 PM »
I could not get local vector3 variables to work properly, so instead, I made three point points that were globals and 3 separate death triggers.

Then theirs trying to get a handle on or figuring out how to make the player launch off of an object. But this is what I have for the prototype so far.

https://db.tt/6WuMWxGO

Curious about what your feedback is. Appreciate it.


cloud03

  • Full Member
  • ***
  • Posts: 249
  • Viva Playmaker!
    • Milkish Game Studios Blog
Re: 2D Physics Based Platformer Tutorial
« Reply #111 on: January 02, 2015, 10:22:42 PM »
Here I've set a quick scene on how I'd do it,
 - I'm using separate spawn triggers on each of the edges.
 - Set them tags to SpawnPoint, and one big trigger below to detect if the player fall, upon triggering each spawnpoint, the player will store the x position value, under the Trigger Spawn Point FSM.
 - and upon falling, when the player trigger the death zone, the next state inside Death/Fall FSM will get the x position value from the Trigger Spawn FSM (I avoid as much as possible using global variable) and then set player position to that X value, with a fixed Y value, in this case 0.7, and 0 on the Z value. All the FSM are only on the player, the spawn point and death trigger does not have any FSM at all.


coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: 2D Physics Based Platformer Tutorial
« Reply #112 on: January 02, 2015, 11:41:04 PM »
How come it's named unity vs unitypackage?

cloud03

  • Full Member
  • ***
  • Posts: 249
  • Viva Playmaker!
    • Milkish Game Studios Blog
Re: 2D Physics Based Platformer Tutorial
« Reply #113 on: January 02, 2015, 11:43:57 PM »
because its a scene, you can put it inside your project folder, and open the scene, I don't use any special assets, just capsule and cubes..

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: 2D Physics Based Platformer Tutorial
« Reply #114 on: January 05, 2015, 12:33:16 AM »
when the player trigger the death zone, the next state inside Death/Fall FSM will get the x position value from the Trigger Spawn FSM (I avoid as much as possible using global variable) and then set player position to that X value, with a fixed Y value, in this case 0.7, and 0 on the Z value. All the FSM are only on the player, the spawn point and death trigger does not have any FSM at all.

The problem I am having is that my level isn't intended to be like a flat floor. This doesn't work in this case because the player is dragged below the stage, making it fall continuously.

Is there a way I could add multiple points(empty objects) or add Get Position action with different local variables like a vector3 so my player can spawn at that point?
« Last Edit: January 05, 2015, 04:02:19 AM by coffeeANDsoda »

cloud03

  • Full Member
  • ***
  • Posts: 249
  • Viva Playmaker!
    • Milkish Game Studios Blog
Re: 2D Physics Based Platformer Tutorial
« Reply #115 on: January 05, 2015, 09:30:39 AM »
in that case, get X and Y values from the trigger, but when applying the Y axis value to the player, offset it a bit, so the player doesn't stuck on the ground when spawning.

In scripting (or visual scripting in this case) use your imagination where is applicable, be creative when using actions and combining with another action, do this and you will get so far when creating games.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: 2D Physics Based Platformer Tutorial
« Reply #116 on: January 05, 2015, 02:37:10 PM »
in that case, get X and Y values from the trigger, but when applying the Y axis value to the player, offset it a bit, so the player doesn't stuck on the ground when spawning.

So you would say for the players FSM (like your example) that it will work if I add set position more than once on different spawns? That's a problem, because each spawn has a different X and Y value. This is a reason why I went with multiple death triggers in the first place.
« Last Edit: January 05, 2015, 03:01:54 PM by coffeeANDsoda »

cloud03

  • Full Member
  • ***
  • Posts: 249
  • Viva Playmaker!
    • Milkish Game Studios Blog
Re: 2D Physics Based Platformer Tutorial
« Reply #117 on: January 05, 2015, 04:58:46 PM »
Yes it would work, but why don't you give it a try before asking here?

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: 2D Physics Based Platformer Tutorial
« Reply #118 on: January 05, 2015, 05:41:22 PM »
Adding set position to the death FSM? Or add separate FSMs for each spawn trigger cube?

cloud03

  • Full Member
  • ***
  • Posts: 249
  • Viva Playmaker!
    • Milkish Game Studios Blog
Re: 2D Physics Based Platformer Tutorial
« Reply #119 on: January 05, 2015, 10:42:43 PM »
Have you check the sample I've uploaded here? the trigger and the death trigger does not need any FSM at all, all of the FSM are being handled by the character.