playMaker

Author Topic: How do you re create get axis vector action?  (Read 377 times)

mrminico

  • Junior Playmaker
  • **
  • Posts: 76
    • View Profile
How do you re create get axis vector action?
« on: January 21, 2019, 11:26:31 AM »
Hi everyone,

So im trying to re create get axis vector since im using rewired for my controller inputs. Now rewired has something get axis 2d which gives you a vector 2 once stored. What advice can you give me on making the vector translate the player in 3d space on the xz plane relative to the camera?



jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14611
  • Official Playmaker Support
    • View Profile
Re: How do you re create get axis vector action?
« Reply #1 on: January 22, 2019, 01:15:45 AM »
Hi,

 you are going to need to map the speed or translation vector you are going to apply to your object from your axis2d.

so let's say, you get from rewire: Input: vector2(Horyzontal,Vertical)

you are going to create a vector3 like this: Velocity: Vector3(Input.x,0f,Input.y)


then you can set the velocity of your objecct using this "Velocity" vector3.

 does that make sense?

given the above, it makes more sense to use simple one axis actions from rewire, since you anyway need to map them in your vector3

Bye,

 Jean