humanoid.MoveDirection - returning 0 for X and Z, why?
Hello,
I want to apply a force to a part once it get touched by a player tool, so here's my script:
01 | local function onTouch (part) |
03 | local player = part.Parent.Parent |
07 | local humanoid = player:FindFirstChild( "Humanoid" ) |
10 | local direction = humanoid.MoveDirection |
11 | print ( 'X: ' .. tostring (direction.X)) |
12 | print ( 'Z: ' .. tostring (direction.Z)) |
13 | print ( 'Magnitude: ' .. tostring (direction.Magnitude)) |
There's no error with the script, moveDirection is always returning 0,0 for X and Z doesn't matter from where I touch this part.
I expected X and Z to have values which would help me to define the force direction.
What am I doing wrong?
Thanks