Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
3

How can I move a camera while its shaking?

Asked by 5 years ago

So I'm making my own camera shake script, and so far its working good. However, I have come upon a problem.

How my scripts works is that first when the shake starts, it saves the camera's CFrame into a variable called oldCFrame. The script then uses this variable as a reference point - the shake is done just by setting the camera's CFrame to oldCFrame + other CFrame values with rightVector and upVector and stuff like that (and this gives me a good shake effect).

The problem is that oldCFrame is never updated; it stays the same from the beggining of the shake to the end. This is a problem because then the camera stays centered around the point where the camera was when the shake begun, instead of moving along with the player. So if a one's screen is shaking and that player moves or jumps, the camera doesn't move with them and so it looks very akward.

I have tried many different things to solve this, including trying to use some of the default camera scripts which are cloned to each player to use them to try to snap the camera into place like I need it, but only to yield no results. The closest I ever got was making the camera rotate at the player, giving it like the Watch camera type effect, however when I did this it messed with the actual shake effect D:

Any help is appreciated, thanks for taking your time to read this :D

0
Trash my idea then :D Forget my answer superalp1111 662 — 5y
0
wait what? why? what was wrong with that? and is there a :D in your comment???? RiskoZoSlovenska 378 — 5y

Answer this question