How do I make an object shake?

Get help using Construct 2

Post » Wed Mar 11, 2015 7:28 pm

Hey. Would love to get enemies to shake for a second when hit by the player. I've seen it in a video, but have no idea how to do it. I think guy used the Scroll To behaviour, but when I use it, it just shakes the whole camera! Can anyone help?
Thanks.
B
7
S
2
Posts: 60
Reputation: 604

Post » Wed Mar 11, 2015 7:44 pm

you could use the sine behaviour, horizontal or vertical (or both with two sine behaviours) and small values for magnitude and period
on enemy hit ->stop movement,set sine active, wait 1 second, set sine inactive
B
37
S
11
G
5
Posts: 485
Reputation: 5,315

Post » Wed Mar 11, 2015 8:02 pm

If you want to do both vertical and horizontal shaking, use different period values for both. Otherwise, it'll just shake diagonally.

Image
Should be a bit faster than this.
B
8
S
2
G
6
Posts: 44
Reputation: 3,007

Post » Wed Mar 11, 2015 8:28 pm

Thanks for the replies. I'm a total noob to Construct, so I'm not really sure what I'm at. I've set the values like this, but it kinda just shifts the object a bit. There's no shaking. Sorry to be a pest.
Image Image
B
7
S
2
Posts: 60
Reputation: 604

Post » Wed Mar 11, 2015 8:33 pm

set magnitude to the amount of pixels it should shift to the sides and period lower
B
37
S
11
G
5
Posts: 485
Reputation: 5,315

Post » Wed Mar 11, 2015 8:39 pm

Aw yeah! That's brilliant! Thanks much!
B
7
S
2
Posts: 60
Reputation: 604


Return to How do I....?

Who is online

Users browsing this forum: 20170217, alimuqaddas, PrinceHata and 7 guests