I’m messing around trying to make a custom character class using OOP so i decided to make a jump function that has a parameter (jumppower), if the parameter isnt used then it will just use the default jump like this
self.hum:ChangeState(Enum.HumanoidStateType.Jumping)
or if it does use a paramter then it does this
self.char.HumanoidRootPart.Velocity += Vector3.new(0,jp,0)
so i decided to do a test where i test both jumps from (0,0,0) to see if they can reach a certain block thats 200 studs high.
the default jumppower is set to 50, i did a test where i put this function in a for loop that runs 30 times, with wait(.25), and i tried this using both jump() and jump(50) and it shows that using jump() which is the default jump is able to reach a certain height up but then using jump(50) it doesnt reach it. why?
print("jump parameter")
for i = 1,30 do
char:Jump(50)
wait(0.25)
end
end
print("jump default")
for i = 1,30 do
char:Jump()
wait(0.25)
end
end
i set the velocity.y to 50 which is the same value jumppower is set to. but obviously they dont work the same because both dont end up with the same result reaching the 200 stud high block. so then how does roblox do their jumps??
im not going to do a function where i set jump power to some value and then activate the jump and then reset it back to what it was originally. that will also cause me problems later.
so this seems like a complicated problem, anyone know?
(im basically asking how do i replicate roblox’s jump system??)