Directional Velocity not giving me the results I want

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I’m currently working on an ODMG from an Anime known as Attack On Titan. Currently, I am trying to create a slinging effect using Linear Velocities and Line Forces. It is not working.

  2. What is the issue? Currently, I am using this formula to find this distance between the characters HumanoidRootPart and the end of the Steel Wire (attachment1).

local DirectionVector = (Character.HumanoidRootPart.CFrame.Position - LatchLeft.Attachment1.CFrame.Position).Unit -- LatchLeft.Attachment1 is where the player should go

This is the function that adds the velocity:

function this.AddVelocityToCharacter(HumanoidRootPart : BasePart, Attachment0 : Attachment, VelocityVector : Vector3): LinearVelocity
	if HumanoidRootPart:FindFirstChild("LinearVelocity") then
		HumanoidRootPart:FindFirstChild("LinearVelocity"):Destroy()
	end
	local Velocity = Instance.new("LinearVelocity", HumanoidRootPart)
	Velocity.Attachment0 = HumanoidRootPart.RootRigAttachment
	Velocity.MaxForce = math.huge
	Velocity.VectorVelocity = VelocityVector
	print(Velocity.VelocityConstraintMode)
	
	return Velocity
end

Again, I want the player to move in the direction of where they are attempting to swing, whether it be up or down or left or right. It kind of works, but I get a wonky result.

At first it seems like it is working, but after a minute I keep drifting sideways as well as moving upwards instead of moving me toward the position of the attachment1.

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I’ve looked everywhere for solutions; testing it out in studio, DevForum, HiddenDevs, etc. Nothing has worked.

1 Like