When the player hits a wall and jumps their jump height is lowered. My game has an invisible barrier that you need to jump into often, but it’s very important to the game mechanics that the players jump height is consistent.
Wall collision jump compared to normal jump (usually the wall is invisible as a barrier)
I want the player to not lose height on their jump when hitting a wall. My two ideas?
A physics based solution that I’m unaware of.
Creating a non-physical barrier through script that only changes the players X and Z positions.
local physicsProperties = PhysicalProperties.new(0.7, 0, 0.5, 1, 1)
local function onDescendantAdded(descendant)
if descendant:IsA("BasePart") then
descendant.CustomPhysicalProperties = physicsProperties
end
end
Maybe the player jumps lower when they have forward momentum, or the y velocity is being cut off by the wall? Jump power might actually be power and not jump height. Maybe alternative could be to apply my own jump force, but even then the same thing might happen anyways.
Actually now that I think about it I don’t think that happens since running and jumping usualy results in the same height. I do think the wall is cutting the player momentum off though.