playMaker

Author Topic: Multiply the X, Y and Z components of a Vector3 individually.[SOLVED]  (Read 3776 times)

markinjapan

  • Full Member
  • ***
  • Posts: 103
As I'm making a 2D game I tend to multiply vectors but I only need to do it in the X and Y, not the Z. Currently, you have to separate a Vector3 into the X, Y, Z, do the maths and then reconstruct it with Z as 0.

Would be nice not to have to do that as it's a bit messy :)

Thanks
« Last Edit: May 31, 2013, 06:31:42 AM by jeanfabre »

Gua

  • Beta Group
  • Sr. Member
  • *
  • Posts: 309
    • Andrii Vintsevych
Re: Multiply the X, Y and Z components of a Vector3 individually.
« Reply #1 on: May 22, 2013, 09:49:33 PM »
Agree.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Multiply the X, Y and Z components of a Vector3 individually.
« Reply #2 on: May 23, 2013, 01:14:45 AM »
Hi,

 or multiply as is, and then set Z to 0,

 or multiply by a vector like Vector3(multx,multy,0)

 Could that not work?

bye,

 Jean

markinjapan

  • Full Member
  • ***
  • Posts: 103
Re: Multiply the X, Y and Z components of a Vector3 individually.
« Reply #3 on: May 31, 2013, 06:18:47 AM »
Yup, that's how I eventually did it.

Just need to think before I type... :)