Rotate this!
OKay, I'm offically stumped. I have an actor that I'm using a magnitude offset to alter the rotation point. This all works well. The trouble I'm having is I would like this actor to rotate in a fashoin similar to a windshield wiper. I've tried using all the methods and behaviors I know. I did get one to work but it was causing crashes as I was using every 0 second timers to force the code to keep going. This is what I don't understand. I set up two rules, one said if self.rotation is 0 then rotate to angle 200. Then I made another rule if self.rotation is = or > 200 rotate to 0. You would think that would work right? Nope it just rotates to 200 and stops. Now here is the rub, if I encapsulate the two rotate to behaviors inside timers set to every 0 seconds, they work and the actor ping pongs as it should but this cause crashes. Throw me your ideas I'm baffled.
Answers
Just a thought...I come across this from time to time. Sometimes I dont think it goes all the way to the exact x/y mark set inside the interpolate/move behavior. I usually set the rules to activate before the set position. I have the actor move to say 200, but the return rules say to activate when it's equal to or greater than 198.
May not work for your issue, but I have had this happen before.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
After that, the two rules have been checked and they are over. GS is simply waiting for some new rules to process. (Its already checked those two.) If you want to have GS check the rules again, wrap them in a timer.
Am I wrong about that? I thought that was a fundamental way in which GS worked...! :S
But things like attributes are only evaluated once (unless the attribute changes).
Sorry for the thread hijack if this is irrelevant to FBS's query.
@MarkOnTheIron's gameproj above doesn't use a timer, and nor does my quick-and-dirty suggestion from this thread: http://forums.gamesalad.com/discussion/comment/345955/#Comment_345955 (note @tenrdrmer's really neat suggestion to tidy it up too) which is kinda similar but less accomplished, so GS must be tracking those Rules continuously. I guess.
Likewise, apologies to FBS for the hijack.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS