Platform behavior and animations - how to get it working?

Get help using Construct 2

Post » Tue Jul 05, 2016 10:10 pm

Hello all,

I have a sprite with a Platform behavior on it, and a sprite animation of "walking".
I've noticed that the collision between the sprite and solids are with their collision polygons, but adding "Bound to layout" is calculated by their bounding boxes, and not by their collision polygons...

So the way I see it, I have 2 options:

1. Make sure all frames are at the same width and height, so collisions between other elements are uniform. This makes animations very limited (can't exceed the width of the frame).
2. Remove Bound to layout and put invisible solid walls at the edges.

In any case, this requires me to edit each and every frame's collision polygon so the collisions are perfectly executed.

Is there another more friendly way of handling this?

Thanks!
B
17
S
7
G
1
Posts: 157
Reputation: 1,878

Post » Tue Jul 05, 2016 11:52 pm

Use an invisible sprite that acts as collision and controller. Set the position of the animated sprite to it.

Something like this.


System every tick (I usually an empty condition since it will calculate it every tick anwyays) --> Set AnimSprite to PlayerController (image point 0)

Don't forget to set:

PlayerController is mirrored --> Set AnimSprite mirrored
same for not mirrored
B
43
S
12
G
14
Posts: 488
Reputation: 10,570

Post » Thu Jul 07, 2016 10:48 am

Thanks @FraktalZero, looks like it's working quite well, although i have tested everything :)
B
17
S
7
G
1
Posts: 157
Reputation: 1,878

Post » Thu Jul 07, 2016 11:47 am

@trueicecold, cool I'm glad :)
B
43
S
12
G
14
Posts: 488
Reputation: 10,570


Return to How do I....?

Who is online

Users browsing this forum: marcinkowski, wizdigitech and 17 guests