#Custom Autojump for Voxels
1 messages · Page 1 of 1 (latest)
Some case notes behind what I am concerned with:
- player stops moving directly in front of the cube. Causing them to go in an infinite loop of teleporting up, falling down, and the raycast returning true again thus causing them to teleport back up. Over and over again.
- playing not being able to jump up the corresponding block due to height
I have a few theories already on how to get 1 to potentially work, and it is by making the player ever so slightly closer to the Block. Small enough that it is unnoticeable, but big enough to make the player climb on top of the Block.
@still turtle ??
Is there any way to smooth it out or no
I'll try, gimmie a min
Can you explain the logic of what you are doing though? I'd preferably like to do it myself as well. 
Basically firing raycast from player, and checking if theres a part in front then tping them above the part
Yeah I took a closer look and yeah xd
0 code.
Roblox's hip height automatically adjusting the model
i mean maybe?
I think what I'm going to try doing is doing the same thing you are doing right now, but then apply the check after.
you want auto jump for small parts right?
at the start there you see him automatically 'climb' up the block (of course he jumps after 😔)
at around 0:02
Customize the values
wait i gotta fix something
local runService = game:GetService("RunService")
local character = script.Parent
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
local humanoid:Humanoid = character:WaitForChild("Humanoid")
humanoid.AutoJumpEnabled = false
local maxAutoJumpDistance = 2
local rayCastDetectionDistance = 1
local jumpDistance = 1
runService.Heartbeat:Connect(function(_delta)
local origin = humanoidRootPart.Position - Vector3.new(0,2,0)
local direction = humanoidRootPart.CFrame.LookVector * rayCastDetectionDistance
local raycastParams = RaycastParams.new()
raycastParams.FilterType = Enum.RaycastFilterType.Exclude
raycastParams.FilterDescendantsInstances = character:GetDescendants()
local result = workspace:Raycast(origin, direction, raycastParams)
if result then
local instance = result.Instance
local position = result.Position
local fixedSize = (instance.Size-position)
if fixedSize.Y > maxAutoJumpDistance then return end
local newDirection = humanoidRootPart.CFrame + (humanoidRootPart.CFrame.LookVector * jumpDistance)
humanoidRootPart.CFrame = newDirection
end
end)
Well
That's certainly interesting
evidently it doesnt work with my character
and im kind of tired to know why xD
Does your character have humanoidRootPart and humanoid?
yeup
1s im going to try it myself
:[
runservice.heartbeat isnt firing
LOL
holdup i have an idea
bruv
btw to get result like this u can try these vals
local maxAutoJumpDistance = 2
local rayCastDetectionDistance = 2
local jumpDistance = .5
nvm I got it xd
i had the script in wrong area
haha
i got mine to work
but holy its so buggy
xD
huh how?
eeeeeh funny
ill try out yours now
Yeah it doesnt work on the 4x4x4's
but it works for the 3^3
increase the size of it
maxAutoJumpDistance
Whats the value of MaxAutoJumpDistance
if you wanna make your character jump big blocks then increase this variable's value
8
unfortunately no matter what i do it doesnt change
weird
Got it to work
local runService = game:GetService("RunService")
local character = script.Parent
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
local humanoid:Humanoid = character:WaitForChild("Humanoid")
humanoid.AutoJumpEnabled = false
local maxAutoJumpDistance = 4
local rayCastDetectionDistance = 1
local jumpDistance = 1
runService.Heartbeat:Connect(function(_delta)
local origin = humanoidRootPart.Position - Vector3.new(0,2,0)
local direction = humanoidRootPart.CFrame.LookVector * rayCastDetectionDistance
local raycastParams = RaycastParams.new()
raycastParams.FilterType = Enum.RaycastFilterType.Exclude
raycastParams.FilterDescendantsInstances = character:GetDescendants()
local result = workspace:Raycast(origin, direction, raycastParams)
if result then
local instance = result.Instance
local position = result.Position
local fixedSize = (instance.Size-position)
if fixedSize.Y > maxAutoJumpDistance then return end
local newDirection = humanoidRootPart.CFrame + Vector3.new(0, instance.Size.X, 0) + (humanoidRootPart.CFrame.LookVector * jumpDistance)
humanoidRootPart.CFrame = newDirection
end
end)```
Changed newdirection to include a vector that changes
it still bugs out though LMAO
Just do
humanoidRootPart.CFrame + Vector3.new(0, fixedSize.Y, 0)
replace instance.Size.X with fixedSize.Y
make use of wedges ig
instance.Size.Y smh
after doing that its pretty smooth
the "lag" you see when teleporting is the result of the camera
nice
I have learned the terminology
it is called voxel stepping
not autojump
Also the video is not what im wanting