Running multiple camera shakes at a time

I made a camera shake module that works perfectly fine although I want multiple camera shakes that were called to run at the same time adding the camera offsets(Humanoid.CameraOffset). together.

However when i tried doing this it just bugged out and got the camera offset to nan,nan,nan (Infinite)

Here’s the calculation I tried doing.

		humanoid.CameraOffset = humanoid.CameraOffset + randomoffset - previousoffset

		previousoffset = humanoid.CameraOffset

The randomoffset is the random generated vector3 and previousoffset is self explanatory.

Ask me if anything is unclarified.

Shouldn’t it be previousoffset = randomOffset? Otherwise the final offset is going to pile up larger and larger over multiple frames.

Thanks so much. I’ve been stuck at this problem for a while.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.