I decided to make aim assist for console players in my shooter game to make it much easier for aiming
but I can’t really achieve what I want. You can’t move your camera freely with aim assist after it focused on a target it stays on them and you can’t move your camera everytime you move it goes back to the target
OR
The aim assist it too weak to be useful and effective when playing on console
The way I made is using math.lookat and lerping camera to that cframe
I tried modifying it so whenever the player moves the camera in a direction opposite to the direction of the target it slows down allowing you to move freely didn’t work for some reason
I would really appreciate any help here is my current code
(Rigs are here instead of players since I don’t have real players playtesting with two players lags my pc so hard)
local Cam = workspace.CurrentCamera
local RunService = game:GetService("RunService")
local DotProduct = nil
local Target = nil
local Speed = 0.0001
task.wait(3)
local LastPosition = Cam.CFrame.Position
local Debounce = false
Cam:GetPropertyChangedSignal("CFrame"):Connect(function()
if Debounce == true then return end
if Target == nil then return end
local GoalPosition = Target.HumanoidRootPart.Position
local NewPosition = Cam.CFrame.Position
local GoalDirection = (GoalPosition - LastPosition)
local PositionDirection = (NewPosition - LastPosition)
local SameDirection = GoalPosition:Dot(PositionDirection)
if SameDirection > 0 then
Speed = 0.009
else
Speed = 0.0001
Debounce = true
task.wait(0.1)
Debounce = false
end
LastPosition = NewPosition
end)
while task.wait(0.1) do
DotProduct = nil
for i,v in workspace:GetChildren() do
local vName = removeNumbers(v.Name)
if vName ~= "Rig" then continue end
if v.Humanoid.Health == 0 then continue end
local Direction = (v.HumanoidRootPart.Position - Cam.CFrame.Position).Unit
local NewDot = Cam.CFrame.LookVector:Dot(Direction)
if DotProduct == nil and NewDot > 0.8 then
DotProduct = NewDot
Target = v
end
if DotProduct and NewDot > DotProduct then
DotProduct = NewDot
Target = v
end
end
local function Aimbot()
if Target == nil then return end
local TargetHRP = Target.HumanoidRootPart
local Direction = (TargetHRP.Position - Cam.CFrame.Position).Unit
local LookAt = CFrame.lookAt(Cam.CFrame.Position,Target.HumanoidRootPart.Position)
Cam.CFrame = Cam.CFrame:Lerp(LookAt,0.0001)
end
RunService:BindToRenderStep("Aimbot",Enum.RenderPriority.Camera.Value - 1,Aimbot)
end
If you have any idea of a better way of implementing aim assist please tell me
I’d recommend not adding aim assist. It actually makes it unfair to PC players, especially if your game is movement based. So many times have I and many others been killed through walls by aim assist—although that can be mitigated through actually implementing it well, which most Roblox games do not.
That being said I’d do something similar to aimbot (but not exactly; i noticed you ARE doing aimbot. aim assist is not aimbot, they’re similar but distinct), where you have a circle around the crosshair and if you shoot, it checks to see if there’s any players inside that circle, it damages them instead of where the bullet actually goes. I haven’t made it myself so I don’t know if it will work well, so that’s purely theoretical.
After skimming through your code, I saw that it appears to be making the camera lock on to a target. That’s not aim assist. That’s aimbot. One is a utility to even the playing field, the other is an exploit. Don’t lock onto a target, instead just change the trajectory of your bullet to hit the target.
Remember: The goal of aim assist is to EVEN the playing field; games like Rivals do NOT do this and instead skew the playing field. The best way to avoid unfair features is to just not implement them, or to do it with extreme care.
You answered your own question Also, I’ve been shot when I was behind someone, several times. Rivals aim assist (hot take: the entire game) is not good; I’m over level 100 in Rivals, so I think I have some say in if Rivals’s aim assist is bad LOL
Sure, I do believe that ping is a contributor; however there have been scenarios where I know both of our ping is low enough to not make a real problem and yet I was still shot through a wall; it’s most likely a problem with the check for if they are behind a wall. I understand that it happens against everyone, but mobile/console is more prevalent due to aim assist. That’s why I said:
because problems are inevitable in anything, and the goal with things like aim assist is to attempt to mitigate as many of those problems as possible; yet problems still arise because again: problems are inevitable in anything
However, if furthered, this “argument” would derail your thread so I’d prefer not to continue
Do you have any idea on how to move the camera to the target in a way it allows you to move camera freely? I will take care of the rest of the aim assist and how it works
Just to make it more fair it’s only for console cause they are the only people who struggle aiming
(I will see if there is any other way if not I will try the one you mentioned)
I’d make an AimingPart in front of the player that rotates with the aim assist. That way, you’re not rotating the camera, but rotating where the “bullet” comes from. Very theoretical, though, as I have not made an aim assist system. Actually just did something similar for my brother’s Minecraft style building system he wanted.