As you see, player jumping when not ‘press’ spacebar but ‘release’ spacebar.
So I opened ‘PlayerModule->ControlModule->BaseCharacterController’
And deleted function which seemed jumping.
I knew that was dangerous idea, but I should BREAK the ‘Press and Jump Rule’.
local ZERO_VECTOR3: Vector3 = Vector3.new(0,0,0)
--[[ The Module ]]--
local BaseCharacterController = {}
BaseCharacterController.__index = BaseCharacterController
function BaseCharacterController.new()
local self = setmetatable({}, BaseCharacterController)
self.enabled = false
self.moveVector = ZERO_VECTOR3
self.moveVectorIsCameraRelative = true
---REMOVED-------REMOVED-------REMOVED-------REMOVED-------REMOVED----
return self
end
function BaseCharacterController:OnRenderStepped(dt: number)
-- By default, nothing to do
end
function BaseCharacterController:GetMoveVector(): Vector3
return self.moveVector
end
function BaseCharacterController:IsMoveVectorCameraRelative(): boolean
return self.moveVectorIsCameraRelative
end
function BaseCharacterController:GetIsJumping(): boolean
---REMOVED-------REMOVED-------REMOVED-------REMOVED-------REMOVED----
end
-- Override in derived classes to set self.enabled and return boolean indicating
-- whether Enable/Disable was successful. Return true if controller is already in the requested state.
function BaseCharacterController:Enable(enable: boolean): boolean
error("BaseCharacterController:Enable must be overridden in derived classes and should not be called.")
return false
end
return BaseCharacterController
I just removed Two lines, and the ‘Press and Jump Rule’ actually broken.
Now player can jump only by releaseing spacebar.
.
.
.
But after this situation, my landing system(down here) not working.
character.Humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
print("ha")
end)
FloorMaterial always changed well but just script not activated after I edited module.
Clearly, it resulted by removing all module. When I put past module, it worked again.
I thought it so easy.
How can I make my custom jump system without this bug?