playMaker

Author Topic: AddForce (Vector3.forward?)  (Read 3402 times)

kici

  • Junior Playmaker
  • **
  • Posts: 63
    • KZ Development
AddForce (Vector3.forward?)
« 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.

« Last Edit: March 09, 2014, 03:10:37 PM by kici »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: AddForce (Vector3.forward?)
« Reply #1 on: March 10, 2014, 07:57:40 AM »
Vector3.Forward is just a shortcut for Vector3(0, 0, 1).

Z is considered forward.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

kici

  • Junior Playmaker
  • **
  • Posts: 63
    • KZ Development
Re: AddForce (Vector3.forward?)
« Reply #2 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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: AddForce (Vector3.forward?)
« Reply #3 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

kici

  • Junior Playmaker
  • **
  • Posts: 63
    • KZ Development
Re: AddForce (Vector3.forward?)
« Reply #4 on: March 14, 2014, 07:54:29 AM »
Thanks a ton!