ViewModel:SetPrimaryPartCFrame(camera.CFrame * cframe) = :LoadAnimation()Īnimations = char:WaitForChild("Humanoid"):LoadAnimation()Īnimations = char:WaitForChild("Humanoid"):LoadAnimation() Local h = char:WaitForChild("Humanoid") or char:FindFirstChild("Humanoid") or nil Local char = plr.Character or plr.CharacterAdded:Wait() Local config = require(viewModel:WaitForChild("Config")) Local viewModel = replicatedStorage:WaitForChild("gunSystem"):WaitForChild("Guns"):WaitForChild():Clone() Local players = game:GetService("Players") Local replicatedStorage = game:GetService("ReplicatedStorage") Local Script: local runService = game:GetService("RunService") Please guide me on how I change my script. I have made a part in the model named “aimPart”. I’ve tried my best with this, but I completely do not understand it. This code was taken from my Spring viewmodel post which constructs the view model purely in code for sharing purposes. PsuedoHRP.CFrame *= CFrame.new():Lerp(addedOffsetToAimAttach, lerpAlpha) Local lerpAlpha = TweenService:GetValue(i,, ) Local addedOffsetToAimAttach = STATIC_OFFSET:Inverse()*CFrame.new(0,-0.1,-3) Local STATIC_OFFSET = psuedoHRP.CFrame:ToObjectSpace(aimAttach.WorldCFrame) Local duration = 0.5 -Time it takes to get into aiming position TweenService because it can provide multiple easing styles, lerping is just used to adjust the aiming CFrame offset from 0 to 1. However here I chose to use both tween service and lerping. Putting this all together we get: local aimCount = 0 Offset = Handle.CFrame:inverse() * Aim.CFrame The First Person Element Of A First Person Shooter Handle.CFrame * offset = Aim.CFrame
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |