#Vector force performs wildly different with and without jump

62 messages · Page 1 of 1 (latest)

hollow ermine
#
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

twilit sleet
#

well first of all i think for what you want to accomplish, ImpulseVectors would be a lot easier to use

hollow ermine
#

they looked so wierd

twilit sleet
#

secondly i think the solution here is to check whether or not the player is on the ground

#

before u apply the force

hollow ermine
#

I added that

twilit sleet
hollow ermine
#

nah I didn't do it

twilit sleet
hollow ermine
#

ill try impulse ig

twilit sleet
#

youll probably still get similar results though, i just suggested impulse because it would make your code way way shorter and simpler

hollow ermine
#

applyimpulse right

twilit sleet
#

try applying drastically different velocities depending on whether or not theyre on the ground

#

Ya applyimpulse

hollow ermine
#

the documentation just tells me how to union things tf

twilit sleet
#

ahahaha whort

hollow ermine
#

well im moving now

twilit sleet
#

thats weird

hollow ermine
#

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

twilit sleet
#

could i see ur new script?

#

the one ur usin with the Impulse

hollow ermine
#

ima remove the mass on the accessories

twilit sleet
#

I dont think accessories have mass

#

cause if they did like

#

it would screw with people's games

hollow ermine
#

they do

twilit sleet
#

are you certain? i really dont think they do...

#

i dont see why they would

hollow ermine
#

well they definitely had mass

twilit sleet
#

they do not

hollow ermine
#

that was it

twilit sleet
#

it changed something? thats very very strange. They should not have mass when equipped

hollow ermine
#

well it was more just mesh parts attached to the char

twilit sleet
#

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

hollow ermine
twilit sleet
#

its irrelevant that it has that

#

while equipped, its automatically massless

#

regardless of that boolean

hollow ermine
#

ah

twilit sleet
#

What issue are you having? is it the same one where you move too much in the air?

hollow ermine
#

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

twilit sleet