Move to touch problem
I_AM_BENJI
USAMember Posts: 40
i have a actor that move to where you touch while staying on the same y axis. Bu when ever i start the game the actor automatically goes to 0 since here is no touch yet. Does anyone have any suggestions.
Comments
Give the instance of the actor a self.Position.X value. And make sure your constrain behavior is inside of a When Touch is Pressed rule.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang
have a different set of rules.
I have a timer
Timer
every 0 secs
move to touch x , 70(where the actor is)
the timer was set so it is constant.
so any suggestions
Cant you just constrain its x position to the attribute?
Need Help? Email Me | Templates | Full Game Source Code
i can but since it starts off at 0 it will still happen
When mouse button is down
change attribute self.pos.x to game.touch.touch1.x
This worked in a quick demo.
Need Help? Email Me | Templates | Full Game Source Code
never mind i fixed it
i made a actor as my background
in the background in made a rule if touched is pressed change attribute move to true otherwise change attribute move to false.
then in the player I made a rule
if move is true then move to touchx, 70 otherwise change attribute self.position.x to self.position.x