#Is there a better way to do recoil?

1 messages · Page 1 of 1 (latest)

visual osprey
#
for i = 0,framework.module.Recoil do
  task.wait(0.000001)
  local CFrame = camera.CFrame * CFrame.Angles(math.rad(1),0,0)
  camera.CFrame = CFrame
end 
``` Is there a better way?
thorny stump
#

or idk

#

i only know tweenservice

visual osprey
#

?

#

cant do that

#

wouldnt be realistic

#

@ember bough

ember bough
#

How does this one look in game?

visual osprey
#

great

#

kinda glitchy

#

when im trying to resist it

#

just wonder

#

if there a better solution

ember bough
#

I've never made recoil so I can only really imagine things but why not simplify some of the code

ember bough
#

So rn ur storing a new cframe but you could just do it all in one statement. Something like

camera.CFrame *= CFrame.Angles(math.rad(1),0,0)
#

Not sure if that will work 100% but you get what I mean

visual osprey
#

that could work i mean

#

just simplier

robust ruin
#

the minimum task.wait can wait is a frame

visual osprey
#

i did that

#

it just

#

skipped to 45 deg

#

theres no smoothness

robust ruin
#

just use tween

#

or lerp

marsh shuttle
#

lerp is good

midnight helm
#

Yea use lerp

#

But it may be too smooth idk

dawn forum
#

Formula
1Rad × 180/π = 57.296Deg

#

maybe try CFrame.Angles(math.deg(1),0,0) instead?

visual osprey
#

doesnt math.rad convert deg to rad

#

and CFrame.Angles only accept rad