L
LanderMiskolczi
Guest
For some reason my camera wont shake, when I press H the screen should shake, but instead it stays still like normal. Here is the step event
The camera is created in an object but I've to put it in manually but that didn't fix it.
Code:
/// Follow the player
if (instance_exists(oPlayer))
{
var xTo = (oPlayer.x - x) / 25;
var yTo = ((oPlayer.y - 16) - y) / 25;
}
x += xTo;
y += yTo;
view_xview[0] = -(view_wview[0] / 2) + x;
view_yview[0] = -(view_hview[0] / 2) + y;
view_xview[0] += random_range(-shakeVal, shakeVal);
view_yview[0] += random_range(-shakeVal, shakeVal);
shakeVal *= .9;