Im Making A Game Called Shoot And Run, But The Gun Is Acting Weird:
-
What do you want to achieve? Fix This Werid Bug
-
What is the issue? I Almost Have No Idea Why This Happens, Heres A Photo
-
What solutions have you tried so far? Few People Had A Very Close Problem That
I Have, But They Are Using Motor6D, Which Its Not What I Want, The Closest Thing That I Saw From A Game Is A Surrealistic Game, I Dont Know If I Can Link The Game Due To It Possibly Breaking The TOS But I Think I Can Show A Picture, So Here Two Pictures Of It
Also I KNOW That The Gun In The Game Above Is NOT A Tool, But I Want The Gun To Be Tool, As It Would Be Easier To Change Weapons
And This Is My Code:
Server:
local gunModule = require(game:GetService("ReplicatedStorage").MainModule.GunModule)
local ts = game:GetService("TweenService")
local tool = script.Parent
script.Parent.Rotate.OnServerEvent:Connect(function(plr,pos:Vector3,rotate:boolean,timee:number)
if rotate then
gunModule.Rotate(tool.Handle,timee,Enum.EasingStyle.Quad,Enum.EasingDirection.Out) --Rotates The Gun, Used When Shooting The Gun
else
ts:Create(tool,TweenInfo.new(timee),{Grip = CFrame.lookAt(tool.WorldPivot.Position,pos).Rotation}):Play() --SUPPOSED To Point The Gun Wheres The Mouse Is
end
end)
Client:
local rs = game:GetService("RunService")
local mouse = game.Players.LocalPlayer:GetMouse()
local rotate = true
local tool = script.Parent
rs.RenderStepped:Connect(function()
if rotate then
tool.Rotate:FireServer(mouse.Hit.Position,false,1)
end
end)
script.Parent.Activated:Connect(function()
rotate = false
tool.Rotate:FireServer(CFrame.new(),true,0.5)
task.wait(0.5)
rotate = true
end)
So, How I Fix It?