*Recently my friend helped make a walljump system that is similar to fe2
Provide an overview of:
-
the code basically checks if the humanoidrootpart was hit and checks if it has a tag called "_Wall or “_Run”, but I am not satisfied with the jump angle and jump velocity that inherits from a attribute in _Wall/ _Run
-
I considered trying to modify a wallrun and jump angle modifier
-
I want modify the jump angle with an attribute under an object value called “_Run”
Here is a video of my wall jumping system,
this is the code of the wall jump system
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local Sound = Instance.new("Sound")
Sound.Volume = 2
local AttachURL = "rbxasset://sounds/action_jump.mp3"
local LandUrl = "rbxasset://sounds/action_jump_land.mp3"
local chararacter = script.Parent :: Model?
local RootPart = chararacter:WaitForChild("HumanoidRootPart") :: BasePart?
local humanoid = chararacter:WaitForChild("Humanoid") :: Humanoid?
local WallAnim = humanoid.Animator:LoadAnimation(game.ReplicatedStorage.Animations.WallJump)
local lastJump = tick()
RootPart.Touched:Connect(function()
local Raycast = workspace:Raycast(RootPart.Position, RootPart.CFrame.LookVector * 1.7)
if Raycast then
if Raycast.Instance:IsA("Part") and Raycast.Instance:HasTag("Walljump") and tick() - lastJump > 0.1 then
local normal = Raycast.Normal
local Hit = Raycast.Instance
WallAnim:Play()
Sound.SoundId = AttachURL
Sound:Play()
RootPart.Anchored = true
RootPart.CFrame = CFrame.new(RootPart.Position, RootPart.Position + normal)
local Jumped = false
local begin = tick()
task.spawn(function()
UserInputService.JumpRequest:Wait()
Jumped = true
end)
repeat
task.wait()
until Jumped
lastJump = tick()
RootPart.Anchored = false
Sound.SoundId = LandUrl
Sound:Play()
if not Hit:GetAttribute("JumpAngle") then
RootPart.AssemblyLinearVelocity = Vector3.new(
normal.X * (humanoid.WalkSpeed * 4),
200 * normal.Y + humanoid.JumpPower + 10,
normal.Z * (humanoid.WalkSpeed * 4)
)
WallAnim:Stop()
else
RootPart.AssemblyLinearVelocity = Vector3.new(
normal.X * (humanoid.WalkSpeed * 2.55),
50 * normal.Y + humanoid.JumpPower + math.rad(math.deg(Hit:GetAttribute("JumpAngle"))),
normal.Z * (humanoid.WalkSpeed * 2.55)
)
WallAnim:Stop()
end
end
end
end)