playMaker

Author Topic: Get Vector  (Read 3339 times)

FractalCore

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 100
Get Vector
« on: August 24, 2013, 05:38:15 AM »
Could there be a use for a Get Vector action. Not one that stores an angle (like 100, -10, 30), but a vector (like 1, -0.1, 0.3). From a selected object.

I need to apply a force to something using a vector, but can't find a way of getting the rotation of an object as a vector, which I could then multiply by a float and apply force. Would be good for raycasting too.

Unless there's already a way to do this that I've missed.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Get Vector
« Reply #1 on: August 24, 2013, 07:44:13 AM »
Hi,

 For this, you have several options:

--  get the velocity of the gameobject, the velocity always is in the direction of traveling, so simply normalize that vector and then apply a multiplier. Use the "Get Velocity" action for this.

-- get the vector of one of the axis of the gameobject. to do this, say you want the vector describing the z axis of a gamobject, you would use "Transform Direction" action and simply set the local direction to what you want. In our case, the z axis, so it will be 0,0,1 the stored result will be a vector describing that local direction in world space.

Does that seem to be what you need?

bye,

Jean