Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: mrbdrm on July 18, 2013, 10:19:06 PM

Title: Get Axis Vector float exceeding 1.0 (SOLVED)
Post by: mrbdrm on July 18, 2013, 10:19:06 PM
Hello
I am using the Get Axis Vector to control my player and sending a float of the "Store Magnitude" variable to mecanim to play a blend tree based on the float range from 0.1 to 1
the problem is when i hit two keys (W and D) the float will be 1.4
how can i limit the float from going above 1?
its all fine when i press one key but when i press two simultaneity the float exceed the 1 limit.
Title: Re: Get Axis Vector float exceeding 1.0
Post by: Alex Chouls on July 19, 2013, 06:08:05 PM
You can use the Float Clamp action.

Note, if you draw a diagram you'll see why magnitude exceeds 1. The horizontal and vertical axes make a square (not a circle as you might expect), so when you press 2 keys you move into a corner of the square, where the magnitude is 1.4.

Using Float Clamp you can constrain the output to be within a circle.
Title: Re: Get Axis Vector float exceeding 1.0
Post by: mrbdrm on July 19, 2013, 08:19:14 PM
Thanks Alex  :)