I’m working on a wall jump system which is generally going well, except for some reason, it is very inconsistent on the part where the player jumps off.
This is how it looks so far:
The issue I’m having is that if you record the distance the player jumps from the wall, it varies so much, usually between 5 and 10 studs but sometimes exceeding 10:
Is your problem that it pushes the player at different speeds every time? If so, I think this should fix it:
Change “humanoidRootPart.CFrame.LookVector” to “humanoidRootPart.CFrame.LookVector.Unit”
Maybe try using ApplyImpulse instead of a very quick body force? The problem might be that the acceleration is acting for 2-3 physics updates, and that variation is causing the differences in each jump?
(Heartbeat is about 1/40, force accelerates mass every heartbeat, 0.05 is time force acts, 0.05 is about 2 heartbeats but might misalign with the heartbeat cycles)
Code example:
local velocityChangeScalar = 20 -- Example value
local humanoidRootPart -- Set to HRP
humanoidRootPart:ApplyImpulse(humanoidRootPart.AssemblyMass * humanoidRootPart.CFrame.LookVector * velocityChangeScale)
I think this might be what I’m looking for, thanks! I’m gonna play around with it and see if I can get it to work properly since it seems to be more touchy than a BodyForce.
@Forummer, yeah I’ve tried many values ranging between like 1000 and 1 million and it seems to produce the same issue.