The question says it all. How would I make BodyVelocity only change 1 axis? The BodyVelocity is in the players head and I am trying to make the player go up at a constant rate when they press SPACE without affecting their WASD movement (x and z-axis) but, when in mid-air, their WASD movement gets suspended and they travel up only. How can I make it so that body velocity only affects their y-axis?
I tried this:
local bodyvelocity = Instance.new("BodyVelocity") bodyvelocity.Parent = character.Head bodyvelocity.P = 1000 mouse.KeyDown:connect(function (key) key = string.lower(key) if string.byte(key) == 32 then spacedown = true bodyvelocity.Velocity = Vector3.new(0,1,0) end end)
This is in a Local Script in the player. 'character' and 'mouse' are defined. The script works but when flying up, the player can no longer use WASD to move their x and z-axis. How would I make the BodyVelocity only affect the y-axis and still allow WASD movement?