Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Norab on December 15, 2015, 08:39:24 AM

Title: "Perfect jump"
Post by: Norab on December 15, 2015, 08:39:24 AM
Hi,

I'm working on a 2D mini game and I want to make my player object do a "perfect jump". I mean that the jump is always on the same distance on X and Y axis in left or right direction (see the example picture below). I tried to do it with "add force 2D" but it seems impossible to do it with physics.

(http://www.norab.fr/images/perfectJump.jpg)

Any idea of how I can do this?

Sorry for my rotten english.
Title: Re: "Perfect jump"
Post by: KellyRay on December 15, 2015, 03:56:43 PM
I'd look into non-physics controlled controllers.

This is one that I've used in the past:

https://github.com/prime31/CharacterController2D

I translated his test input script to a playmaker action here:

http://hutonggames.com/playmakerforum/index.php?topic=11323.msg53395#msg53395

Good luck!
Title: Re: "Perfect jump"
Post by: Norab on December 15, 2015, 07:14:55 PM
@kellyRay, it could be a good solution if I have an idea of what you talking about :P
Thank you anyway for trying to help.

I think I found a solution : use one Itween Move To for each axis with an ease on Y axis.

Now the question is : If I use two Itween Move To for each move (so 4 actions in any), how much does it will affect the memory usage?
Title: Re: "Perfect jump"
Post by: KellyRay on December 15, 2015, 08:45:04 PM
I'm unfamiliar with iTween, so I'd be useless there.

The non-physics based controller is essentially like the character controller component unity provides. You download Prime 31s 2d character controller script. Tell it what tags to look for as a platform and then use my FSM action to control it.
Title: Re: "Perfect jump"
Post by: Norab on December 16, 2015, 08:44:31 PM
Thank you for your proposition, but finally I decided this would be the platforms that would move, so I no longer need controller on my player object.

However, I know that your script exists and there are chances that I use it in the future.

So, thank you again!