Hello,
So I was trying to see if I could emulate a camera shake (like when you get hit). I'm not having much success though. Does anyone have a good way to do this?
What I was trying to do is rotating it based on my delta time. Such as:
if(bShake) {
dt+=deltaTime;
if(dt > 0.01)
camera.rotate(90);
if(dt > 0.03)
camera.rotate(-100);
if(dt > 0.06)
camera.rotate(110);
etc....
if(dt>1.f)
shake=false;
(set the camera back to default)
dt=0;
}
and ending back to the normal position.
It doesn't work how I imagined it. It's very slow, I tried messing with the times to make them quicker. I'm looking for a way to do this correctly. A very quick back and forth (rumble) Thanks.