Im trying to manipulate only the Y velocity in my code. When its greater than zero i want it to be set back to zero, but I keep getting an error that says “Y cannot be assigned to”. How do I change only the Y velocity individually?
Code:
while freefall do
local yvel = (glider.Velocity.Y / 2)
glider.Velocity = mouse.Hit.lookVector * Vector3.new(25,40 - yvel,25)
gyro.CFrame = mouse.Hit
if hrp.Velocity.Y >= 0 then
hrp.Velocity.Y = 0 --Line where error is
end
wait()
end.