Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: redsett on January 02, 2014, 06:45:58 PM

Title: Adding a Dash[SOLVED]
Post by: redsett on January 02, 2014, 06:45:58 PM
Hello, I just started using Playmaker so this is my first post/question(I'm loving it!).

I'm trying to add a "dash" to my character, where he translates in 1 axis for a given amount of time. I got everything working fine except because I'm using the "Translate" action, the collision on the character controller doesn't work so he goes flying through walls. So my question is does anyone have any suggestions on what to use instead of "Translate?" Or maybe another method?
Title: Re: Adding a Dash
Post by: cloud03 on January 02, 2014, 09:29:40 PM
Do you use rigidbody component? if it is, I would recommend to use add force action, and add a big value to the wanted axis, but don't check every frame, so it will only give a moment of boost....
Title: Re: Adding a Dash
Post by: redsett on January 02, 2014, 09:48:17 PM
Thanks for the fast reply. I tried that as well, it kinda worked but the character will flip side ways or upside down while the force is applied. Maybe I'm doing it wrong. :)

Edit: If I turn on "Is Kinematic" it doesn't flip out but it doesn't push either.
Title: Re: Adding a Dash
Post by: jeanfabre on January 03, 2014, 04:41:45 AM
Hi,

 you can constraint your object to only be able to translate on one axis.

http://docs.unity3d.com/Documentation/Components/class-Rigidbody.html

do you would "freeze" two axis and all rotations, and leave the translation axis free, then it will be very stable.

bye,

 Jean
Title: Re: Adding a Dash
Post by: redsett on January 03, 2014, 01:34:03 PM
Thanks again for the reply.

I must have it all set up wrong because with freeze all but 1 axis it doesn't move at all(and yes it's the right axis). And the rigid body has killed my jump/double jump( I'm using "itween move by" for that). Maybe I'm looking for a different way to go about this. Is there a way to tell if the controller is colliding and then I could tell the dash to stop.
Title: Re: Adding a Dash
Post by: cloud03 on January 03, 2014, 11:20:52 PM
could you attach a stripped down package (no artwork of any kind, don't include the playmaker, and replace the character with a capsule)? And I'll check your file...
Title: Re: Adding a Dash
Post by: redsett on January 06, 2014, 03:28:21 PM
I got it working by: Getting the vector the character is facing(I used "Get Direction Vector"), using a "Vector Multiply" to multiply that vector(which will be the speed), then placing that vector on a "Controller Move." Works great. Thanks for the input guys!