Opacity Sine + Fade (in/out) not working together

Discussion and feedback on Construct 2

Post » Sat Feb 11, 2017 12:27 pm

Hi. I added some god rays (just a white rectangle with transparent gradient) and added a sine for opacity. But when I try to fade in and out the sine effect is stopped during the fade in and out transitions. Does anyone know a workaround for this so the current opacity is maintained during the fade out effect? And during fade in no opacity changes are made until the fadein is completed.

I experimented with some other solutions like events testing for the current value and cycle position (sine) but I could not fix it yet.
Bl4ckSh33p-Soft - Custom Software and Indie Games
B
58
S
18
G
6
Posts: 756
Reputation: 9,591

Post » Sat Feb 11, 2017 3:48 pm

Try setting the "Active at start" property of "Sine" to "No".
And in your events, do this event:

+On fade-in finished
-Set Active (Sine)" Yes.

Oh, and when the fade-out time comes; however you have programmed it to fade-out, just throw in another action to turn the Sine off.

Let me know if this works!
B
51
S
20
G
10
Posts: 571
Reputation: 9,819

Post » Sun Feb 12, 2017 4:35 pm

Thanks! I had another idea with works great with layer opacity. All rays are on a layer and I just set opacity to opacity.self+1*timescale. This preserves the current opacity of each ray and the sine effect while showing/hiding the layer.

I tried to implement your idea but I had so many garbage in the code (old / disabled) that it did not work in a reasonable time. But it should be working and I will use it the next time I add new god rays where I cant just add them on a new layer.

Its much faster and easier with the layer. :)
Bl4ckSh33p-Soft - Custom Software and Indie Games
B
58
S
18
G
6
Posts: 756
Reputation: 9,591


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 14 guests