Hello! I havent made a post on the forum in years.
I’m looking for some advice on how to create a ‘lock on’ system that alot of PVP games have nowadays. My goal is to create a system where the camera is angled a certain way and follows a selected target, making it easier for players to aim attacks and making it possible to code homing attacks (attacks that follow a target continuously). The issue is that im not sure where to start with that.
Ive looked online and around the forum but I cant find anything helpful, some advice or examples would be greatly appreciated. Thank you for your time
You could have a “camera block” that follows the player around which should give you some freedom to customize the position of where the camera goes and you can use the roblox’s cframe thing to make the camera constantly point at the target via renderstepped or some form of that.
local Runservice = game:GetService(“RunService”)
Runservice.RenderStepped:Connect(function()
Camera.CFrame = CFrame.new(Block.Position, Target.Position)
end)