You can write your topic however you want, but you need to answer these questions:
-
Hello, during the creation of my game and its movement system, I’ve run into a problem concerning vertical surfaces.
-
For some reason, the player changes direction when a wall or any object brushes against or touches them from the side.
-
I’ve tried changing the physics and even the rotation system, but it hasn’t worked. There’s also a solution that breaks my game quite a bit, and that’s the player’s or Humanoid’s Autorotation. I’m sure you know what this does.
I need some help or advice. I’m not sure if it’s relevant, but I’ll include how the turning and acceleration systems work. Obviously, there are other things like the camera module and some states, but I’d prefer not to show too much for now.
–Turning System (Both are executed via RenderStepped):
local rotationValue = 0
if TurnToLeft then
rotationValue = TurnVelocity
elseif TurnToRight then
rotationValue = -TurnVelocity
end
if (TurnToLeft and TurnToRight) or (not TurnToLeft and not TurnToRight) then
rotationValue = 0
end
local currentCFrame = RootPart.CFrame
local rotationCFrame = CFrame.Angles(0, math.rad(rotationValue) * deltatime, 0)
RootPart.CFrame = currentCFrame * rotationCFrame
–Acceleration System:
if AccelerateFront then
CurrentVelocity = CurrentVelocity + AcceleratesVelocity * deltatime
elseif AccelerateBack then
CurrentVelocity = CurrentVelocity - AcceleratesVelocity * deltatime
else
CurrentVelocity = CurrentVelocity
end
...
--Player Move
local moveDirection = RootPart.CFrame.LookVector
RootPart.AssemblyLinearVelocity = moveDirection * CurrentVelocity