How do I Create a 3d movement effect using sine?

Get help using Construct 2

Post » Tue Dec 09, 2014 6:47 am

We are trying to make an object change based upon it Y coordinates. So far we have been using Compare Y at different points and set scale to .1 difference if closer or further but this makes it look somewhat clunky and the transition isn't as smooth as it could be. I feel if there was a way to get absolute Y and increase/decrease scale automatically it would be much better. IE for ever 1 past Y 550 increase scale .01 for every 1 549 and before decrease scale .01 with magnitudes set likely max 1 and min .2 or something. I like how Sine resizes but also can figure out how to make that based on the Y axis location.

Sorry I am a construct 2 virgin and I know my 10 events to do this using compare y and set scale is likely a bad use of the events. I do ask if you have a better/easier way if you would explain to me how you figured it out and not just spit out a line of code :) I want to learn not be spoon fed.

Thank You
ecoay
B
4
Posts: 6
Reputation: 212

Post » Tue Dec 09, 2014 9:12 am

You can do that with an equation

Every tick
---sprite: set scale to lerp(0.2, 1, sprite.y/480)

That will set the scale to 0.2 if y is 0 and set the scale to 1 if y is 480. All other y positions will set the scale smoothly from the y position. You can play with the numbers until you get the look you want.
B
91
S
31
G
103
Posts: 5,235
Reputation: 67,756

Post » Tue Dec 09, 2014 9:41 am

oh awesome! I didn't know you can set equations in set scale. Thank you! This is very useful. Running into some issues with this now where the ball freezes after two bounces in mid air. Maybe I didn't enter something correctly and will test further after 8 hours asleep.... Ben a long long day.
B
4
Posts: 6
Reputation: 212

Post » Tue Dec 09, 2014 6:15 pm

Playing with it again today can't quite figure out why this stops after one bounce and becomes frozen mid bounce even when hit with a immovable physics object.
B
4
Posts: 6
Reputation: 212

Post » Thu Dec 11, 2014 2:56 am

Is this a bug or is scaling not meant to be done on the fly? To replicate this can create 4 walls and make them immovable and then make a quick platform to kick the ball you will see after bounce the ball freezes in mid air every time. Unless again I am doing something wrong
B
4
Posts: 6
Reputation: 212

Post » Thu Dec 11, 2014 3:03 am

Perhaps a .capx or at the very least a screenshot of your events will get you the answers you seek.
B
86
S
43
G
71
Posts: 601
Reputation: 43,619

Post » Mon Dec 22, 2014 8:22 pm

Sorry been busy with Christmas stuff. Here is the capx. I know it is terrible lol. This is just testing fucntionality,
You do not have the required permissions to view the files attached to this post.
B
4
Posts: 6
Reputation: 212


Return to How do I....?

Who is online

Users browsing this forum: NN81, plinkie, sublimate, TsubaRu and 10 guests