I have a pretty basic custom character system , I need collisions for it at the moment i am setting the characters parts to CanCollide but its kinda glitchy/weird and i have no idea where to start
local MoveVector = (PrimaryPart.CFrame * Vector3.new(CharacterController.CharacterMovement.X * (DeltaTime * WalkSpeed) , 0 , CharacterController.CharacterMovement.Z * (DeltaTime * WalkSpeed)))
PrimaryPart.CFrame = CFrame.new(MoveVector , MoveVector + Vector3.new(DirectionVector.X , 0 , DirectionVector.Z)) * CFrame.Angles(0 , math.rad(360) , 0)
this is how i move the character CharacterMovement is a Vector2 Value form the inputs
Luanoid. It’s a custom character system written entirely in Lua. The camera is kinda broken, but the rest of the system is much stabler than any other attempt.
There is also an
editable place on Roblox itself featuring it, but it’s a but out of date.
May 15, 2019, 3:13pm
Remember to put a disabled humanoid in your physics model, otherwise physics may throttle and lag for slow devices. This likely won’t help or fix anything for you in studio now, but it will prevent the game from being unplayable on phones.
Looks like the physics engine working as intended…
This is a feature called “physics throttling”. If the physics engine detects that it can’t keep up with realtime it starts stepping the world less frequently and everything appears to move ~4x slower. Some bodies, like Humanoids are never subjected to throttling.
We do this to prevent going into a death spiral, getting further and further behind realtime.
i checked that already but i don’t quite under how it works
They cast multiple rays in shape of a cylinder to detect collisions around the character, then they group those positions into a mean plane that they use for physics.
I can cast the rays but how would i use it?
castCylinder is the module you are looking for. Located in RepFirst in CharacterControllerCore.
So far i don’t understand a thing except it casts rays in a cylinder shape and i don’t even get the concept properly on how it helps with the collisions