#Gun Movements

1 messages · Page 1 of 1 (latest)

ember epoch
#

How do I make gun movements in first video?
I tried to detecting if the camera has moved left but it's not smooth.

local lasty = Y
function Rotate()
    local CurrentRotation = workspace.CurrentCamera.CFrame
    local X,Y,Z = CurrentRotation:ToOrientation()
    
    
    if Y > lasty then
        RotationCF = RotationCF:Lerp(CFrame.Angles(0,math.rad(10),0),.1)
        print("moving left")
    elseif    Y < lasty then
        RotationCF = RotationCF:Lerp(CFrame.Angles(0,-math.rad(5),0),.1)
    end
    
    
    lasty = Y
end

Runservice.RenderStepped:Connect(function()
    
    if not framework.viewmodel then return end
    
    if framework.viewmodel and framework.viewmodel:IsDescendantOf(camera) then
        framework.viewmodel:SetPrimaryPartCFrame(camera.CFrame * RotationCF)
    end
    Rotate()
end)
end```
civic wasp
#

here's my camera movement sway, hope it works for you

local mouseDelta = UIS:GetMouseDelta()
local divCam = 50
local divRot = 150

local swayCamX = math.clamp(mouseDelta.X/divCam, -0.3,0.3)
local swayCamY = math.clamp(mouseDelta.Y/divCam, -0.3,0.3)
            
swayCam = swayCam:Lerp(CFrame.new(-swayCamX, swayCamY, 0), .3)
            
-- CAMERA SWAY ROTATION
            
local swayRotX = math.clamp(mouseDelta.X/divRot, -0.03,0.03)
local swayRotY = math.clamp(mouseDelta.Y/divRot, -0.03,0.03)
            
swayRot = swayRot:Lerp(CFrame.Angles(-swayRotY,-swayRotX, 0), .1)
#

you probably know this, but you just multiply the cframe by swayRot and swayCam

ember epoch
#

Thanks! It works

#

You mainly do guns?

civic wasp
#

i mean thats what im working on right now

#

learned a lot in making my weapons system, #1 thing being DO NOT USE ANYTHING BUT THE TOOLS SYSTEM

#

THE AMOUNT OF RECODES😭😭😭

ember epoch
#

kinda wild

civic wasp
#

then i kinda frankensteined the movement sway into the rotation sway

#

its fun learning like that :D

civic wasp
#

if i can find it

#

it was nearly a year ago atp

ember epoch
#

I use a diff sway formula ```lua
function Sway()
local rot = camera.CFrame:ToObjectSpace(lastCameraCF)
local X,Y,Z = rot:ToOrientation()
swayCF = swayCF:Lerp(CFrame.Angles(math.sin(X) * currentSwayAMT, math.sin(Y) * currentSwayAMT, 0), .08)
lastCameraCF = camera.CFrame
end

civic wasp
#

yeah to be terribly honest you probably know more important math than i do

ember epoch
#

I followed tutorials

#

Im bad at math

civic wasp
#

same dude

ember epoch
#

@civic wasp

#

https://youtu.be/IKm7hTgnqx0?si=cC9aeLJ_pom4Ye8l

the gun shooting kinda makes the gun kick backwards , is it messing with the rotational value and position?

9mm SMG ( mp5, variant mp5a3 )

sounds: soundly app + https://gamebanana.com/sounds/28178\
models: mp5a3 from "the comprehensive gunk kit" on roblox toolbox
viewmodel is a collection of stuff i found from tooblox

apps: premiere pro for editing, blender for animating, moon animator for recordings

follow my twitter https://twitter...

▶ Play video
civic wasp
#

are you using an animation or an elaborate algorithm for recoil

ember epoch
#

no im not talking about the recoil

#

im talking about when the gunshoots

#

it kick backwards

#

is it animation?

#

or cframe manipulating

civic wasp
#

just use an animation

#

shouldnt be too hard

ember epoch
#

kk

#

you hv made a bullet spread?

#

incase u want one, i hv it

#

it's a circular bullet spread

civic wasp
#

not really planning on bullet spread outside of shotguns and snipers when youre not adsed

ember epoch
#

kk

#

why dont you apply for s1?

#

you deserve a s1

civic wasp
#

s1?

ember epoch
#

scripter 1

civic wasp
#

ah

#

where might i apply?

ember epoch
#

Choose scripter and choose for level 1

#

u need 4 projects

civic wasp
#

4 projects i helped other people with or 4 projects of my own?

#

i see

#

4 scripts

#

shouldnt be too hard, i project hopped a lot before settling on my current one

ember epoch
#

of your own

#

you will be accepted

civic wasp
#

alright