I want to have object A grow in size when object B touches it.If I do this with the sine behavior, it will grow and then decrease in size. I want it to remain at the new size.
How can I achieve this?
Develop games in your browser. Powerful, performant & highly capable.
Check every tick or every seconds if the object's size has reached a value, then disable the Sine behavior and set the object's size by yourself if needed (using scale object property, or dimensions directly).
How would I check every tick if the objects size has reached a value? Every tick is an event and compare x and y is an event —
the way that definitely works:
set objBox sine wave active (e.g. when colliding)
wait x seconds (x= half of the wave - if the wave would need 2 seconds set it to 1)
set objBox sine wave inactive
Should also work
You could check the sine cycle position in an IF statement
Thanks. Would I do that through events? if so, which? fm4fanAT
here is the smallest version I can think of
make on sprite object and give it the sine behaviour
set the sine movement to size and period to 4, magnitude 50
system > on start of layout | objSprite > set sine active
| system > wait 1 second
| objSprite > set sine inactive