Fake camera shake (fail)

henlo, i have tried to make a fake camera shake effect (fcs) but i couldn’t get it to move smoothly so i ended up making an earthquake effect. the code you add to the update script of the object you want to move is here.
this.rotation += random.integer(1,3,5,7,10);
this.rotation -= random.integer(1,3,5,7,10);
this.x += random.integer(1,3,5,7,10);
this.y -= random.integer(1,3,5,7,10);
this.x -= random.integer(1,3,5,7,10);
this.y += random.integer(1,3,5,7,10);

i know the code is garbage but thats all i can do ¯_(ツ)_/¯

2 Likes

P.S im not asking for help, im just sharing my failed attempt and the “earthquake” code. :)

Looks cool! Good job, I like how u could see the floor through the red square
(that was a nice touch)

1 Like

thx man. :)

1 Like

I would suggest using random.range(1, 10) instead of putting those 5 numbers. nice job though. :slight_smile:

1 Like

yeah i added the numbers in between because i thought “oh, if i add a number in between, maybe there will an inbetween and it will be smooth!” spoiler alert, it didnt work.

Just to make life simpler, this is the same equation as urs, but put down to 3 lines:

this.rotation+=random.integer(-10,10);
this.x+=random.integer(-10,10);
this.y+=random.integer(-10,10);
//maybe try to change the number 10 to see a difference
2 Likes

At least I can recognized that everything is shaking. :) Right now, if you apply that code to all the scene objects, every object will shake in different directions. A suggestion would be to execute that code in only one place (Main Frame or Main Object) and then have the other scene objects reading those values, but with different magnitudes based on the “camera” depth. Objects further from the camera should visually shake less than the nearest.

2 Likes

i love it :smiley: :smile: :heart_eyes: :star_struck: :crazy_face: :slightly_smiling_face:

Welcome to the forums @myuzernamesthis6

It has returned… :thinking: