Arrows move actor left-right?
Eminem
Member Posts: 667
I haw two arrows set up on left and one right I have this actor and I want the user when touch the arrows the actor moves to that side anyone know how to do this
Cheers,
Cheers,
Comments
Have two global variables - Booleans - call them 'Left' and 'Right'
On the left arrow have a rule:
If touched:
Change 'Left' to True.
Change 'Right' to False.
On the right arrow:
If touched:
Change 'Right' to True
Change 'Left' to False
On the player actor:
If Left = True
Move actor left
If Right = True
Move actor Right
If you want to change the direction the actor is facing, you can always use different images depending on whether Left or Right is true.
Hope that helps!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
then i created a new rule but changed it to attribute and then i chose game.left is true and game.right is false
and i did the same for the right but the opposite
in the player i created a new rule and choose attribute and put game.left is true and inside i put a move left behaviour
and
creat rule attribute and it is gmae.right is true move right
but when i play it it stays still is there something im doing wrong?
They should be GLOBAL attributes, not on the actor itself. i.e. they should be game.left, not self.left for example.
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Just help others out with what you learn!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io