Changing an attribute in a timer + Rotation check
Kozax
London, UKMember Posts: 9
in Help Wanted
Hello,
I have a two issues with the game I am currently working:
I have an attribute called difficulty. So I have:
Every Difficulty Seconds => Change another attribute and do a couple of other things.
The Difficulty attribute changes successfully from another event and it doesn't have any problem.
The issue is, the event(every Difficulty seconds) doesn't update after the attribute difficulty is changed later on in the game.An Actor is affected by physics. Is there any way to check when it has rotated 360 degrees?
Thank you
Comments
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thank you for your reply @tatiang
I created an attribute(ActorAngle). When the game starts I save the actor angle(self.Rotation) to ActorAngle attribute.
I made it work so If Self.Rotation >= 180 then game.Score +10 but it only works once because later on the rotation is being increased.
Could you please give me a hint for resetting the attribute but also make it work for the other side (-180) ?
I know i need to compare it but it confuses me how to save the variable and how to update it
Thanks
I'm not sure about -180 but to reset it, just change self.StartRotation to self.Rotation. That way, when self.Rotation is 0, self.StartRotation is 0 and you compare it to self.Rotation as it changes until it gets to self.StartRotation + 180. When you then reset self.StartRotation to 180, you can then compare self.Rotation again as it changes to see if it is greater than or equal to self.StartRotation + 180.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
%360 and abs are your friends here !