playMaker

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

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 609
    • View Profile
Re: 2D Physics Based Platformer Tutorial
« Reply #30 on: November 14, 2014, 01:49:02 PM »
Newb question icloud03, how would 2D gameplay work on pre-unity 4.3 versions? I ask this because, when I was experimenting with playmaker plus the standard character motor, and platform controller scripts that unity provides, a issue would be the Z axis is enabled and my character would just fall off of a level.
« Last Edit: November 14, 2014, 01:51:42 PM by coffeeANDsoda »

cloud03

  • Full Member
  • ***
  • Posts: 230
  • Viva Playmaker!
    • View Profile
    • Milkish Game Studios Blog
Re: 2D Physics Based Platformer Tutorial
« Reply #31 on: November 14, 2014, 04:49:02 PM »
@coffeeANDsoda: do you mean 2D Gameplay with 3D objects pre 4.3? If its the case, I simply constraint the Z axis on rigidbody, and don't use the standard character motor, on these tutorials, I'm not using any standard script from unity, I build it with playmaker from scratch.
Or another way of doing it, if its not possible using constraint. Just add a invisible collider on each of the edge, and create a physics material, set the friction to 0 then assign the material to the invisible collider. This will make the character stay on the ground, and not fall off of a level.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 609
    • View Profile
Re: 2D Physics Based Platformer Tutorial
« Reply #32 on: November 17, 2014, 03:17:56 PM »
Invisible collider IE a boxed collider?

cloud03

  • Full Member
  • ***
  • Posts: 230
  • Viva Playmaker!
    • View Profile
    • Milkish Game Studios Blog
Re: 2D Physics Based Platformer Tutorial
« Reply #33 on: November 17, 2014, 06:26:05 PM »
yup, shape can be anything as long it is a collider, with no mesh renderer, so it is invisible and it will hold the character to stay on the ground

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 609
    • View Profile
Re: 2D Physics Based Platformer Tutorial
« Reply #34 on: November 17, 2014, 10:04:39 PM »
Right now, I'm having issues with other playmaker games that I am working on, so I'd like to dig into some of these 2.5D playmaker tutorials of yours to make a game using this type of perspective and reveal it.
« Last Edit: November 17, 2014, 10:22:54 PM by coffeeANDsoda »

cloud03

  • Full Member
  • ***
  • Posts: 230
  • Viva Playmaker!
    • View Profile
    • Milkish Game Studios Blog
Re: 2D Physics Based Platformer Tutorial
« Reply #35 on: November 18, 2014, 01:42:03 AM »
Sure! let me know if its already available then, can't wait to see it :)

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 609
    • View Profile
Re: 2D Physics Based Platformer Tutorial
« Reply #36 on: November 18, 2014, 03:56:37 PM »
Isn't there a way to do animation without mecanim? Because I thought about using other means or just go with a static image for now.


cloud03

  • Full Member
  • ***
  • Posts: 230
  • Viva Playmaker!
    • View Profile
    • Milkish Game Studios Blog
Re: 2D Physics Based Platformer Tutorial
« Reply #37 on: November 18, 2014, 06:56:22 PM »
You can use the legacy one, but you won't be able to use sprite animation, if it is a 2d game, and you use some sort of ik for the 2d character (with splitted body parts, and parented inside unity, then animated), you can use legacy animation, there is a thread regarding this.

But I'm all about mecanim right now, for me it is really good, and once you grasp the concept behind it, there is nothing you can not do literally with mecanim. For me there is no reason to not use mecanim, and I don't think I'm gonna go back with legacy again...Is there any difficulties for you with mecanim system?

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 609
    • View Profile
Re: 2D Physics Based Platformer Tutorial
« Reply #38 on: November 18, 2014, 07:32:14 PM »
I'd just like to know what other alternatives are out there.
« Last Edit: November 19, 2014, 07:26:40 PM by coffeeANDsoda »

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 609
    • View Profile
Re: 2D Physics Based Platformer Tutorial
« Reply #39 on: November 19, 2014, 07:31:34 PM »
Plus, I'd like to set up a jumping system by adding another FSM without parenting another object in order to make the player land naturally.  Can't I add force on another state with a negative value of force, since if my character is going to jump, I'd have to use the Y axis.

cloud03

  • Full Member
  • ***
  • Posts: 230
  • Viva Playmaker!
    • View Profile
    • Milkish Game Studios Blog
Re: 2D Physics Based Platformer Tutorial
« Reply #40 on: November 19, 2014, 08:37:59 PM »
What kind of jump do you want to achieve?

If you mean with parenting another object is the groundDetect, you can use raycast for ground detecting, that will eliminate the needs of a trigger object such as groundDetect.

Of course you can add "add force" to another state with negative value, I'm not sure though with what you are trying to achieve by this, could you elaborate more?

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 609
    • View Profile
Re: 2D Physics Based Platformer Tutorial
« Reply #41 on: November 19, 2014, 08:42:06 PM »
What kind of jump do you want to achieve?

A type of jump that applies for an area with normal gravity which includes 2 FSM's on one object(the player). Basically I want my character to jump normally.
« Last Edit: November 19, 2014, 08:58:55 PM by coffeeANDsoda »

cloud03

  • Full Member
  • ***
  • Posts: 230
  • Viva Playmaker!
    • View Profile
    • Milkish Game Studios Blog
Re: 2D Physics Based Platformer Tutorial
« Reply #42 on: November 20, 2014, 12:22:54 AM »
Well, the jump part of the tutorial is actually quite normal, it is using unity physics, so gravity automatically takes into account.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 609
    • View Profile
Re: 2D Physics Based Platformer Tutorial
« Reply #43 on: November 20, 2014, 12:39:07 AM »
Though it still acts like the player is jumping on the moon.

cloud03

  • Full Member
  • ***
  • Posts: 230
  • Viva Playmaker!
    • View Profile
    • Milkish Game Studios Blog
Re: 2D Physics Based Platformer Tutorial
« Reply #44 on: November 20, 2014, 04:50:26 AM »
well in that case, you can increase the mass of the character, to make it heavier, so it will feel more realistic, just try fiddling the mass character, and the jump force to get the best feel you're looking for...