Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Nekoyoubi on April 19, 2011, 05:53:36 PM

Title: Vector3 test?
Post by: Nekoyoubi on April 19, 2011, 05:53:36 PM
What is the best way to test a Vector3 against zero?

I'm wondering because I would assume the best way to break out my Moving action from my Idle on my player object would be to set the Vector3 with Get Axis Vector, store it in an FSM variable, and then test that variable to see if it should move state.

Is this correct?
Title: Re: Vector3 test?
Post by: marvmiller on April 19, 2011, 06:17:19 PM
I'm thinking there should be Math and Logic actions for vectors just like there are for floats.  Vector Add, Multiply, Vector Compare etc.
Title: Re: Vector3 test?
Post by: Nekoyoubi on April 19, 2011, 07:14:28 PM
There are actions for Vector3 Add and Vector3 Multiply, but not a Vector3 Compare that I could find anywhere.
Title: Re: Vector3 test?
Post by: Alex Chouls on April 19, 2011, 07:19:37 PM
You can Store Magnitude in Get Axis Vector and use Float Compare on that...
Title: Re: Vector3 test?
Post by: Nekoyoubi on April 19, 2011, 07:24:41 PM
You can Store Magnitude in Get Axis Vector and use Float Compare on that...

Have I ever told you you're my hero?

Actually, that should clean up the issue at hand, but now I'm curious, am I just missing a Vector3 Compare somewhere?
Title: Re: Vector3 test?
Post by: marvmiller on April 20, 2011, 01:57:13 PM
uhh.. apparently I need glasses because I totally missed the whole Vector3 category, thinking they would be in the Math category.  Still a vector3 compare would indeed be handy  :)
Title: Re: Vector3 test?
Post by: Nekoyoubi on April 20, 2011, 02:37:09 PM
I guess you probably wouldn't want to try to figure out a Greater Than or Less Than, but I would think a result of Equal or Not Equal and a flexible Tolerance would make for a powerful Vector3 Compare. Really, this seems like it would just be a Get Distance, but comparing the distance of Vector3's; not Game Objects.

Alex, should I get to it you think, or do you already have something like this?
Title: Re: Vector3 test?
Post by: Alex Chouls on April 21, 2011, 03:54:59 PM
Sounds great!
Title: Re: Vector3 test?
Post by: julius on January 31, 2013, 11:11:09 PM
Hey don't know if its still relevant or if you got around to making it, but I made a vector3 Compare action.

http://hutonggames.com/playmakerforum/index.php?topic=3058.0 (http://hutonggames.com/playmakerforum/index.php?topic=3058.0)