What do you want to achieve? Keep it simple and clear!
Prevent player from slowing down
What is the issue? Include screenshots / videos if possible! robloxapp-20240816-1616265.wmv (1.4 MB)
Player goes slower here and the clone gets out of the view
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Idk if theres solutions on dev hub
Note: game has no mobile support so u wont be able to replicate bug if u wanted
Script that makes the player move
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local addSideMax = 1
local finalVector = Vector3.new(0, 0, -1)
--[[RunService.RenderStepped:Connect(function()
if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
local humanoidRootPart = player.Character.HumanoidRootPart
end
end)]]
RunService:BindToRenderStep("move", Enum.RenderPriority.Character.Value + 1, function()
if player.Character then
local humanoid = player.Character:FindFirstChild("Humanoid")
if humanoid then
humanoid:Move(finalVector, true)
end
end
end)
UserInputService.InputBegan:connect(function(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.A then
finalVector = finalVector + Vector3.new(-addSideMax,0,0)
elseif inputObject.KeyCode == Enum.KeyCode.D then
finalVector = finalVector + Vector3.new(addSideMax,0,0)
end
end)
UserInputService.InputEnded:connect(function(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.A then
finalVector = finalVector + Vector3.new(addSideMax,0,0)
elseif inputObject.KeyCode == Enum.KeyCode.D then
finalVector = finalVector + Vector3.new(-addSideMax,0,0)
end
end)
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local addSideMax = 1
local moveSpeed = 16
local finalVector = Vector3.new(0, 0, -1)
RunService:BindToRenderStep("move", Enum.RenderPriority.Character.Value + 1, function()
if player.Character then
local humanoid = player.Character:FindFirstChild("Humanoid")
if humanoid then
local magnitude = math.max(1, finalVector.Magnitude)
humanoid:Move(finalVector.Unit * moveSpeed, true)
end
end
end)
UserInputService.InputBegan:Connect(function(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.A then
finalVector = finalVector + Vector3.new(-addSideMax, 0, 0)
elseif inputObject.KeyCode == Enum.KeyCode.D then
finalVector = finalVector + Vector3.new(addSideMax, 0, 0)
end
end)
UserInputService.InputEnded:Connect(function(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.A then
finalVector = finalVector - Vector3.new(-addSideMax, 0, 0)
elseif inputObject.KeyCode == Enum.KeyCode.D then
finalVector = finalVector - Vector3.new(addSideMax, 0, 0)
end
end)
This script is trying to set a constant move speed.
The one that went into the wall is the player, when the player goes into the wall it slows down, and the clone (one on the right) gets out of view
I want the player to maintain speed
The clone is not slowing down at all. When you hit the wall it kind of looks like it is. But if you watch the ground and feet it really don’t look like it lost a step (slide in this case).
Because they hit a wall … is the wall to not have collision set? If so, that is part of the parts that make up the wall. Click on the wall part. Remove the check from collision.
Unless others help you here. Our conversation is getting a bit too large. You can PM me if you want to ask more questions. I will need: A full explanation of what you’re doing with this game?
What is it… How is really to be working… What have you tried to fix the problem and what is the problem. I have never seen your code before today. So, I don’t even know what it is you’re looking to do here. It looks like a race … Don’t hit the wall.