Hello, I have been coding something called ODM. Right now, you can orbit in a direction left or right or hook to a point.
However there is 0 momentum, after you let go, you simply fall. I don’t know what to do to fix this. I am using Linearvelocity for the movement and alignorientation to rotate the player towards the target.
Heres an example of what something could look like when I add momentum, smooth, it flings you up, leaning makes you fling to the right or left, and you don’t instantly fall.
Just because its deprecated doesn’t mean you can’t use it at all, well I’ve found that sometimes the newer forces that require attachments arent the best for the movement im trying to apply to a given scenrario as well
function ODMModule.CreateMover(char,direction)
local ForwardMover = Instance.new("LinearVelocity")
ForwardMover.Name = direction.."_Mover"
ForwardMover.Parent = Library.HumanoidRootPart
ForwardMover.RelativeTo = Enum.ActuatorRelativeTo.World
ForwardMover.MaxForce = 100*1000
ForwardMover.VelocityConstraintMode = Enum.VelocityConstraintMode.Vector
local AlignMover = Instance.new("AlignOrientation")
AlignMover.Name = direction.."_Mover"
AlignMover.Parent = Library.HumanoidRootPart
AlignMover.MaxAngularVelocity = 100*10000
AlignMover.MaxTorque = 100*1000
AlignMover.Responsiveness = 100
AlignMover.Mode = Enum.OrientationAlignmentMode.OneAttachment
end
function ODMModule.MovePlayer(char,A0,A1,direction)
local ForwardMover
for i,v in pairs(Library.HumanoidRootPart:GetChildren()) do
if v:IsA("LinearVelocity") and v.Name == direction.."_Mover" then
ForwardMover = v
end
end
ForwardMover.Attachment0 = A0
ForwardMover.VectorVelocity = CFrame.lookAt(Library.HumanoidRootPart.Position,A1.WorldPosition).LookVector*ODMModule.GetSpeed(char)
end
function ODMModule.RotatePlayer(char,A0,A1,direction)
local AlignMover
for i,v in pairs(Library.HumanoidRootPart:GetChildren()) do
if v:IsA("AlignOrientation") and v.Name == direction.."_Mover" then
AlignMover = v
end
end
AlignMover.Attachment0 = A0
AlignMover.CFrame = CFrame.lookAt(Library.HumanoidRootPart.Position,A1.WorldPosition)
end
Here is the mover and rotation functions. Its called on by the client (optimization), upon letting go, a remove script sets all their values to nil, which is what is causing them to drop down I’d imagine.
function ODMModule.removeHook(direction,HRP)
if direction == "Left" then
Library.Values.LeftHook.Value = nil
else
Library.Values.RightHook.Value = nil
end
for i,v in pairs(HRP:GetChildren()) do
if v.Name == direction.."_Mover" and v:IsA("AlignOrientation") then
v.Attachment0 = nil
v.Attachment1 = nil
elseif v.Name == direction.."_Mover" and v:IsA("LinearVelocity") then
v.Attachment0 = nil
v.VectorVelocity = Vector3.new(0,0,0)
task.wait(0.05)
elseif v:IsA("Beam") then
if v.Name == direction.."_Hook" then
ODMModule.retreactTween(v.Attachment0,v.Attachment1,v,direction)
v.Attachment0:Destroy()
v.Attachment1:Destroy()
v:Destroy()
end
end
end
end
Well your setting the VectorVelocity to Vector3.zero, which is making them drop down rather quickly, how about you try tweening the VectorVelocity to Vector3.zero, using tweenservice
Well honestly for a small project im working on right now, I’m currently using BodyVelocity to move my player because it allows me to specify force on a specific axis, which I can’t do with the newer ones
elseif v.Name == direction.."_Mover" and v:IsA("LinearVelocity") then
local goal = {}
goal.VectorVelocity = Vector3.new(0,0,0)
local tweenInfo = TweenInfo.new(0.25,Enum.EasingStyle.Sine,Enum.EasingDirection.In)
local tween = Library.Services.TweenService:Create(v,tweenInfo,goal)
tween:Play()
tween.Completed:Wait()
v.Attachment0 = nil
end
Maybe try having something that will keep the player upright while using the ability and maybe try playing around with the tween time and the easing style
What you want to do is disable the physics on the Humanoid by setting its state to Physics. You’ll have complete control over the maneuvering that way, if you’re brave enough to try that because it’s a lot of physics to consider…
EDIT: It doesn’t have to be Physics the whole way, you can set it to Physics every time you know they’re on air for example.