I made a shaking script

I made this script in February for my animations (which are not public yet). It just makes an object shake. The code may be a bit messy

Code

// make sure this script is in an object and put in load.

// put the origin x and y here
// make sure to update values when you change the origin positions
var originpos = [86.735,-47.707];

// controls intensity of the shaking
var intensity = 20

// controls intensity of the rotation effect
var rotintense = 1

onEvent(‘update’, function () {
this.x = random.float(Math.round(originpos[0]) - intensity, originpos[0])
this.y = random.float(Math.round(originpos[1]) - intensity, originpos[1])
this.rotation = random.float(-rotintense, +rotintense)
});

=============UNCOMMENTED VERSION

var originpos = [86.735,-47.707];

var intensity = 20

var rotintense = 1

onEvent(‘update’, function () {
this.x = random.float(Math.round(originpos[0]) - intensity, originpos[0])
this.y = random.float(Math.round(originpos[1]) - intensity, originpos[1])
this.rotation = random.float(-rotintense, +rotintense)
});

Here is a demo!
violentshakingtest2-10-2024_19-31-42.wick (969.4 KB)

1 Like

rocky be shaking tho lol