Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: C.J.Geringer on October 27, 2015, 08:27:25 PM

Title: 3D Jump with XZ speed conservation
Post by: C.J.Geringer on October 27, 2015, 08:27:25 PM
I have a  3D movimentation system where the player can go forward/backwards and right/left with varying movement modes that have different speeds (animated trough root motion).

I need a system where whenever the character jumps, his  speed in hte X and Z actions is conserved, and his Y speed obeys a parable (he won´t be able to change directions mid-jump, nor control the height of the jump once he leaves ground). Ideally a Y axis force would be applied and gravity would take care of the rest, but this won´t work since character controllers aren´t affected by physics like that.

I intend to use the same behaviour after leaving ground whenever the character is ungrounded (e.g.: walks off a ledge, or is pushed out out of one).

Would someone please advise me on the best way to achieve this?

Thank you for your time.
Title: Re: 3D Jump with XZ speed conservation
Post by: C.J.Geringer on October 28, 2015, 08:14:50 PM
I am trying to "get velocity", disable root motion, adding a y component to the vector gotten, and then "set velocity" to the new vector with added y component.

But even though it´s checked "every frame" Get velocity does not seem to be working, when I run the game the "speed" vector3 variable I created keeps being "0, 0, 0"

any ideas what might be happening?
Title: Re: 3D Jump with XZ speed conservation
Post by: C.J.Geringer on October 30, 2015, 06:02:37 AM
Apprently "get velocity", needs a rigid body to work, and one shouldnot use a rigid body with a character controller.

Does anyoen know a work around for this, before I try to make my own custom action?