Help with Rule
B1984
Member, PRO Posts: 91
I'm trying to get a turret to rotate when a game attribute is true.
Steps taken:
Created a game attribute Boolean "RB"
Created a button, rule= Touch is pressed, change game attribute "RB" to true
Turret rule= If game attribute "RB" is true, then Rotate counter clockwise
Seems simple right? But it's not working... the turret has zero physics and is movable, the background that it on has zero physics... I'm puzzled and I know it's something simple that I'm just overlooking. Any help appreciated, if not... I'm sure I'll figure it out with 3-4 more cups of coffee.
Steps taken:
Created a game attribute Boolean "RB"
Created a button, rule= Touch is pressed, change game attribute "RB" to true
Turret rule= If game attribute "RB" is true, then Rotate counter clockwise
Seems simple right? But it's not working... the turret has zero physics and is movable, the background that it on has zero physics... I'm puzzled and I know it's something simple that I'm just overlooking. Any help appreciated, if not... I'm sure I'll figure it out with 3-4 more cups of coffee.
Comments
Is this button a toggle button? When you press it one time it makes it false and another time true? Do you have it set for on Touch Release? If not done properly, those can be a pain in the butt and not function as you would expect.
Something so simple, but kicking my butt and this is the easiest part about this experiment.
Have you tried 2 rules? One with Touch Pressed making it true and one with Touch Released setting it false. If that doesn't work properly you can always have it be Constrain Attribute to True while Pressed.
I don't know... I can't seem to get the button to change the game attribute boolean to true once in game. I can start it as true, then when I click it stops but that's the end of the run. Maybe I'll try an integer.
Rule: If Touch Pressed
Rule: If RB True
Change Attribute RB False
Otherwise
Change Attribute RB True
The second rule is inside the Touch rule and the true Attribute change is the otherwise of the second rule.
This is driving me crazy because it's such a simple thing and it doesn't work. Game booleans can be toggled, right?
Thanks for the brainstorming, Fallacy.