playMaker

Author Topic: Adding a Dash[SOLVED]  (Read 4171 times)

redsett

  • Playmaker Newbie
  • *
  • Posts: 6
Adding a Dash[SOLVED]
« 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?
« Last Edit: January 06, 2014, 03:29:37 PM by redsett »

cloud03

  • Full Member
  • ***
  • Posts: 249
  • Viva Playmaker!
    • Milkish Game Studios Blog
Re: Adding a Dash
« Reply #1 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....

redsett

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Adding a Dash
« Reply #2 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.
« Last Edit: January 02, 2014, 10:17:06 PM by redsett »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Adding a Dash
« Reply #3 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

redsett

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Adding a Dash
« Reply #4 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.

cloud03

  • Full Member
  • ***
  • Posts: 249
  • Viva Playmaker!
    • Milkish Game Studios Blog
Re: Adding a Dash
« Reply #5 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...

redsett

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Adding a Dash
« Reply #6 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!
« Last Edit: January 06, 2014, 03:31:23 PM by redsett »