Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: kici on March 09, 2014, 03:08:59 PM

Title: AddForce (Vector3.forward?)
Post by: kici on March 09, 2014, 03:08:59 PM
Hi,

Im playing with some rigidbodies here etc, using the locomotion teddy bear sample system, and I'd like to add force to the character but going forward, so far I can only give it Vector3(x,y,z) or Vector2, or just x,y,z

how can I give Vector3.forward for example, not just for this sample demo scene but for anything in general, maybe thats a unity thing and it only works with transform? thanks

edit: I've checked some of the transform possibilities, I still cannot figure out how to add a forward force.

Title: Re: AddForce (Vector3.forward?)
Post by: Lane on March 10, 2014, 07:57:40 AM
Vector3.Forward is just a shortcut for Vector3(0, 0, 1).

Z is considered forward.
Title: Re: AddForce (Vector3.forward?)
Post by: kici on March 10, 2014, 11:20:13 AM
Makes sense thank you,

What I am trying to do is, I have an object with iTween and checking Trigger, once it hits the Player I want the player to get pushed the direction iTween object was moving towards, how would I calculate this with playmaker?

thanks
Title: Re: AddForce (Vector3.forward?)
Post by: jeanfabre on March 14, 2014, 07:46:44 AM
Hi,

 to get this, use this custom action ( cause get velocity action only works with RigidBody)

http://hutonggames.com/playmakerforum/index.php?topic=1182.msg4961#msg4961

 use this vector3 result, as the base for the force ( multiply it by a factor to exagerate the effect)

Bye,

 Jean
Title: Re: AddForce (Vector3.forward?)
Post by: kici on March 14, 2014, 07:54:29 AM
Thanks a ton!