# Sine behavior question

Get help using Construct 2

### » Wed Mar 22, 2017 2:57 pm

Hey everyone,

Is there a way to allow a sine behavior with SIZE movement to oscillate the object's size between, say, 20% to 60%?

In other terms, if I apply the behavior on an object of 100x100 pixels with magnitude to 40, I will always get a sine movement between 80 and 120% of the objects' standard size. I would like to make its size vary from 20 to 60 pixels without changing the size of my base object (which should remain 100x100 pixels).
Possible?

B
39
S
10
G
1
Posts: 369
Reputation: 3,448

### » Wed Mar 22, 2017 4:17 pm

Not fully understanding your issue, but try using an invisible helper object with the sine behavior/motion size you want, and pin the full size object to it.
B
60
S
30
G
133
Posts: 1,947
Reputation: 74,871

### » Wed Mar 22, 2017 8:34 pm

I am not sure how you can change the size without changing the size. I do believe we need a more clear example of your intended goal.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
81
S
22
G
8
Posts: 664
Reputation: 10,333

### » Wed Mar 22, 2017 10:15 pm

It sounds like you are describing the bulge effect?

Look at that effect and you can set radius and use an event like every so many seconds to change the effect.

You can change size directly of any object but if you want it changed over time then you need to use a timer and every so many seconds or every tick.
Banned User
B
29
S
7
G
58
Posts: 1,229
Reputation: 34,910

### » Thu Mar 23, 2017 2:25 am

It would be nice if you could modify the Sprite.Sine.Value, but the behavior doesn;'t allow for that.

you'd have to do it manually... I'm sure the math is here on the forums somewhere...
B
103
S
35
G
16
Posts: 1,227
Reputation: 17,198

### » Thu Mar 23, 2017 5:02 am

I can imagine a double sine behavior.

Create a decoy sprite with sine behavior: NUMBER ONLY
Give you main object the SIZE SINE behavior and set magnitude to DECOY.Number

There you go!
"The intent is to provide subscribers with a sense of pride and accomplishment for unlocking different features...."
B
42
S
18
G
32
Posts: 818
Reputation: 20,779

### » Fri Mar 24, 2017 10:50 am

I have an object whose size is 100x100 pixels.
If I add a sine/size behavior with 20 magnitude, it's size will oscillate between 80 and 120 pixels (if I'm correct)
I want it to oscillate between 20 and 60 pixels.
Is there a way to achieve this using the sine behavior?

@MPPlantOfficial
I've been able to make it work with your solution! It's a bit complex to set up, though... ^^'

I think it's possible to give both sine behavior to the same object or use math to set size of object every tick to the value of the (value) sine behavior, so we use only one sine.
B
39
S
10
G
1
Posts: 369
Reputation: 3,448

### » Fri Mar 24, 2017 11:15 am

B
67
S
24
G
7
Posts: 1,519
Reputation: 11,104

### » Fri Mar 24, 2017 11:29 am

@korbaach
Thank you for the elegant demonstration.
B
39
S
10
G
1
Posts: 369
Reputation: 3,448