Access to the "If Touch Is Pressed" attribute?
Hey forumers!
Does anyone know if it is possible to change the If Touch Is Pressed toggle in an actor without actually touching it? I would like to use actor (a) to receive the touch from the player and then change a game.TouchAttribute from False to True. Then if game.TouchAttribute is True then change If Touch Is Pressed to True in actor (b).
Best Answers
-
viking Posts: 322
Good question
I need actor (b) If Touch Is Pressed to change from False to True when actor (a) is touched - even if actor (b) was never touched. I can use a game state attribute in the Or section, but then I would have to redo a million lines of code, which is what I am trying to avoid.
If I could just switch the If Touch Is Pressed using a change Attribute it would be a lot easier. But I think you are right in that it is not possible to change this state unless you touch the actor.
Answers
@viking how about using the following rule in actor(b)
Rule (any)
if touch is pressed
or
if game.TouchAttribute = true
...
end rule
I do not know of a way to set Touch to true
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Hi there @Hopscotch I don't think that will work because most of the logic in actor (b) is waiting for Touch Is Pressed to be True before it can fire.