I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: StuffandThings on September 10, 2016, 01:23:10 PM

Title: Object Wobble Effect
Post by: StuffandThings on September 10, 2016, 01:23:10 PM
I tried out Klazen's 'wobble' code:
(click to show/hide)

but I want to use it in a slightly different way. I'm trying to figure out how to set it up so that you place an instance in the room, and edit the creation code to have the same effect. It seems that this way, any instance you place will have the same properties and the wobbles will be in-sync. But what if I wanted to control each instance, and make them all wobble differently (instead of making more objects)?

I tried to setup some variables to call from the creation code but I keep getting an error saying "objWobble.(variable) not set before reading it."  I tried something along the lines of this:
(click to show/hide)

I know the variables have to be initialized first, but even when I did get GM to accept the code, there was no wobble. How would I set this up?
Title: Re: Object Wobble Effect
Post by: WetWookie on September 10, 2016, 01:28:41 PM
In studio the Creation Code takes place after the Create Event so all you have to do are give wobble_speed and/r wobble_distance a different value in the instances creation code. (ie. wobble_distance = 64);
Title: Re: Object Wobble Effect
Post by: StuffandThings on September 11, 2016, 12:25:30 AM
wow...I was making that way more complicated than necessary haha. Thanks!
Title: Re: Object Wobble Effect
Post by: L4Vo5 on September 12, 2016, 11:53:08 PM
You can also change aa to make them start desynchronised