How do I make Hand held camera / Shaky camera?

Get help using Construct 2

Post » Mon Sep 12, 2016 11:18 am

Is it possible to make hand held camera in C2?

Something like this, but not in 3d:
https://youtu.be/B1sTWSxtyXo?t=4m45s
B
9
S
3
G
3
Posts: 3
Reputation: 2,293

Post » Mon Sep 12, 2016 12:59 pm

I think you can do it by lerping a random position.

If you're using the scrollto behaviour, create a dummy called (CamAim) object that has the scrollto behaviour.

Create another dummy object called shake.

Every random(0.2,0.8) seconds.
---> Shake, set X position to windowWidth/2+(random(-10,10))
Every random(0.2,0.8) seconds.
---> Shake, set Y position to windowHight/2+(random(-10,10))

You can replace "WindowWidth/2 & windowHight/2 with your characters XY position if or any other point where you want the camera to be center.

Then...

Every tick.
Set CamAim position X to lerp(self.X,shake.X,random(0.1,0.2))
Set CamAim position Y to lerp(self.Y,shake.Y,random(0.1,0.2))

I don't have Construct 2 in front of me now, but something like that should work,

This should create some kind of slight random movement.
Follow my progress on Twitter
or in this thread Archer Devlog
B
40
S
17
G
17
Posts: 991
Reputation: 12,654

Post » Fri Sep 16, 2016 1:59 pm

Oh, thank you for your knowledge, here's the capx made by those values:
https://1drv.ms/u/s!Au4NFDIvBHhRi61Awo1U6ewNKPcY5g

It's little bit rough and "cubic" - I'm trying to make the movement smaller and smoother, like this:

Every random seconds
random(0.1,0.3)
random(0.1,0.3)

Shake (object)
X > windowWidth/2+(random(-5,5))
Y > windowWidth/2+(random(-5,5))

Every tick
lerp(self.X,shake.X,random(0.05,0.1))
lerp(self.Y,shake.Y,random(0.05,0.1))

here's the capx with those values:
https://1drv.ms/u/s!Au4NFDIvBHhRi60-VjIRrrXUAmh9xw

I was wondering - could "Sine" be added to camAim and to these events and actions to make the shakiness little bit smoother?
B
9
S
3
G
3
Posts: 3
Reputation: 2,293


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 47 guests