#Vector force performs wildly different with and without jump
62 messages · Page 1 of 1 (latest)
local function dash()
local c = player.Character
if c.Name == "Astolfo" and debounce == false then
debounce = true
local h = c.Humanoid
local hrp = c.HumanoidRootPart
local loadedA = h.Animator:LoadAnimation(anim)
local dashdirection = nil
local movedirection = h.MoveDirection
local lookvector = hrp.CFrame.LookVector
if movedirection == Vector3.new(0, 0, 0) then
dashdirection = hrp.Position + Vector3.new(lookvector.X, 0, lookvector.Z)
else
dashdirection = hrp.Position + Vector3.new(movedirection.X, 0, movedirection.Z)
end
local gyro = Instance.new("BodyGyro")
gyro.Parent = hrp
gyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
gyro.D = 0
gyro.P = 500000
gyro.CFrame = CFrame.lookAt(hrp.Position, dashdirection)
local attachment = Instance.new("Attachment")
attachment.Parent = hrp
local force = Instance.new("VectorForce")
force.Parent = hrp
print(hrp.AssemblyMass)
force.Attachment0 = attachment
force.Force = Vector3.new(0, 0, -velocity)
loadedA:Play()
h.AutoRotate = false
wait(duration)
h.AutoRotate = true
force:Destroy()
gyro:Destroy()
attachment:Destroy()
loadedA:Stop()
wait(cooldown)
debounce = false
end
end
here's the code
I removed hrp.AssemblyMass * Workspace.Gravity + 5 from force.Force
which I thought would make me not drag on the ground
it did not
well first of all i think for what you want to accomplish, ImpulseVectors would be a lot easier to use
they looked so wierd
secondly i think the solution here is to check whether or not the player is on the ground
before u apply the force
I added that
Really? u must have done something weird then
nah I didn't do it
tweak it more. Give them much less velocity if they're in the air and way more if they're on the ground
ill try impulse ig
youll probably still get similar results though, i just suggested impulse because it would make your code way way shorter and simpler
applyimpulse right
try applying drastically different velocities depending on whether or not theyre on the ground
Ya applyimpulse
the documentation just tells me how to union things tf
ahahaha whort
well im moving now
thats weird
backwards
hrp:ApplyImpulse(Vector3.new(0, 0, velocity))
velocity is 4000
why am I goin backwards
also I feel like a force may be better for the effect I want to achieve
it jus dont work
apparently it's because of my custom character @twilit sleet
im confused
i dont think that should affect it at all
could i see ur new script?
the one ur usin with the Impulse
ima remove the mass on the accessories
I dont think accessories have mass
cause if they did like
it would screw with people's games
they do
well they definitely had mass
that was it
it changed something? thats very very strange. They should not have mass when equipped
Meshes have no mass either
what problem are you having that led you to believe it was your accessories?
i may be able to help
i have a lot of experience with movement vectors
Ohh i see why this confused you now
its irrelevant that it has that
while equipped, its automatically massless
regardless of that boolean
ah
What issue are you having? is it the same one where you move too much in the air?
I ended up removing the ability to do it in the air or jump while doing it
now I just need a ton of force
ahh okay. I hope that isnt too bad of a compromise. If you ever change your mind, its very very easy to fix the moving too much in the air.