Weird Result

Discussion and feedback on Construct 2

Post » Sun Feb 05, 2017 6:07 pm

Hey guys, I hope this was the right place to ask, but I'm having a not intended result with an event.

With one of the animations frames of an animation I trigger a screenShake, and same screenShake is applied once the character lands.
It works great, only problem is that is not working in the whole scene.
I'm using for testing two objects with Solid applied. But shake works only on the solid in which the character is at the Start of the layout.

Any ideas?

Thanks in advance!
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Sun Feb 05, 2017 6:34 pm

It's probably not a good idea to use a frame to trigger something since frames can be skipped.
That is unless it's at the end of an animation.
Timer behavior perhaps?
Image ImageImage
B
169
S
50
G
174
Posts: 8,324
Reputation: 110,792

Post » Sun Feb 05, 2017 9:51 pm

ah that could be a good solution!
What I do is

Image
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Sun Feb 05, 2017 10:34 pm

Do it simple:

https://www.dropbox.com/s/ctefw1x1zrzkx ... .capx?dl=0

The layout's Unbounded scrolling property must be set to Yes, if you want it to shake on the sides.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Sun Feb 05, 2017 11:39 pm

Thanks @99Instances2Go indeed its simpler, but I still face the same problem:
Shake works only on one solid but not on both.
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Sun Feb 05, 2017 11:59 pm

I have no idea what 'landedState' stands for. And how you set or unset it.
I have no idea if you change the animation when it lands on a platform.
I have no idea if you have player_2 in a container with animPlayer_2 , so picking one would pick the other.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Mon Feb 06, 2017 12:07 am

-landstate is used to change the animations when landing. I use two different animations depending whether is a normal jump or power jump.
-I dont change the animations on platforms, the animation is only changed depending jump type
-no, animPlayer_2 is only pinned to player_2.
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Mon Feb 06, 2017 12:19 am

-no, animPlayer_2 is only pinned to player_2.

Then that is your problem. You dont pick the player_2 that belongs to animPlayer_2.

Can pick it by PinnedUID, i think.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Mon Feb 06, 2017 1:34 am

Thanks! I should try that too. But this is getting weirder hahaha
On the same solid object I can execute the action in one spot but not another, yet its the same object I'm jumping on. what the? lol
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Mon Feb 06, 2017 6:57 pm

I was going to say make sure the other object is not on a layer that can't be moved (like a HUD layer) - I always accidentally put things on the wrong layer...

But it could also be that the screen has no room to shake where the one object is (close to the layout edge). So, like 99Instances2Go said, if the layout is not set to unbounded, then you have to be far enough away from the edges of the layout for the shake to be able to scroll back and forth. (in other words, the edges of the layout have to be off screen)
B
97
S
34
G
20
Posts: 438
Reputation: 17,790

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 23 guests