Shadow position and angle?

Get help using Construct 2

Post » Thu Dec 19, 2013 12:30 am

Hi,

I need help with the pin behavior. I would like the plane's shadow to follow the plane while staying below it. How can I achieve this effect?


example and capx
B
12
S
4
G
1
Posts: 100
Reputation: 2,362

Post » Thu Dec 19, 2013 12:37 am

Don't bother with pin behavior for this.

Every tick - set shadow position to plane.x + dx, plany.y + dy
           - set shadow.angle = plane.angle

That should do it.Colludium2013-12-19 02:17:42
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,193

Post » Thu Dec 19, 2013 1:02 am

I got an error, "Dx Unknown Expression"
B
12
S
4
G
1
Posts: 100
Reputation: 2,362

Post » Thu Dec 19, 2013 1:09 am

@Colludium dx and dy??
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361

Post » Thu Dec 19, 2013 1:20 am

@Joannesalfa and @ThunderLion:

Sorry - not clear at all! I meant delta x and delta y as in your intended displacement for the shadow from the plane.

For example:
every tick, set shadow position to: plane.x + 10, plane.y + 10
The above would put the shadow to the bottom right of the plane (by just over 10 pixels straight line).
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,193

Post » Thu Dec 19, 2013 2:42 am

It works perfectly! Thanks so much!
B
12
S
4
G
1
Posts: 100
Reputation: 2,362

Post » Thu Dec 19, 2013 6:41 am

@Colludium Talking about the improvement, What's about we can implement a sun which relate to shadow position?
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361

Post » Thu Dec 19, 2013 12:02 pm

@Jannesalfa - Good question. I like a challenge so I'm going to make a quick tutorial!
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,193


Return to How do I....?

Who is online

Users browsing this forum: alextro, Ryan Kocourek and 1 guest