So, if anyone reading this has played armored patrol Armored Patrol v9.5 - Roblox (newer version)
They’d know that the gun system, the way to represent aiming in it is to make the characters rotation and the arm rotations where the mouse is pointing
an example:
Well, you’d probably need to detect the changes made every time the Mouse moves so you’ll need to use a LocalScript for this Instance
You can get the Mouse by doing Player:GetMouse(), and using the RenderStepped event from the RunService you can detect where you want the Character to look at (Hopefully in a smooth transition?):
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Character = Player.Character or Player.CharacterAdded:Wait()
local RunService = game:GetService("RunService")
local Root = Character:WaitForChild("HumanoidRootPart")
RunService.RenderStepped:Connect(function()
local MousePos = Mouse.Hit.Position
Character:SetPrimaryPartCFrame(CFrame.new(Root.CFrame.Position, Vector3.new(MousePos.X, Root.CFrame.Position.Y, MousePos.Z))
end)
For the character facing the where the gun is, I believe you can use Motor6D’s:
man, i was kinda dumb when i first posted this and was just looking for someone to write a script for me. oh well, time has passed and i’m looking into this stuff again. anyways, thanks for this, very helpful now that i know more about lua and what not.