Possible Bug with Move To Behavior
RMS
Member Posts: 3
I am running 0.0.92. I am very new with GameSalad. Your patience is appreciated.
I have a simple Move To behavior. It works the majority of the time, however in some unpredictable instance, after it the actor moves, it immediately resets to its original position.
Since I'm new, I'm just trying to get the hang of this with a few test apps. I put a small app together with a single actor. The objective I have is to have the actor move from it's first position to a second position when I touch it. The next time I touch it, I would like it to move back to its original position. So it should move from one position to the next each time I touch.
Here are the basics:
When an actor receives a Touch Inside{
-Save its position (because I am going to move it back to the original position when it is touched again)
-Move To the new position}
If the actor is in new position{
-Set the next target position (saved above in the When Touch Inside)
-Save the current position (to be able to move back after the next move)}
It basically works the way I want. It toggles back and forth from one positon to the next. But occasionally (maybe once out of every ten times) and unpredictably after it makes a move, it resets to the position it held before the most recent touch.
Are there problems with "Move To"? I am not certain that this is a bug. I have been working with this for less than a week, so the problem may definitely be at the keyboard.
Any advice is appreciated.
Thanks,
Aaron
I have a simple Move To behavior. It works the majority of the time, however in some unpredictable instance, after it the actor moves, it immediately resets to its original position.
Since I'm new, I'm just trying to get the hang of this with a few test apps. I put a small app together with a single actor. The objective I have is to have the actor move from it's first position to a second position when I touch it. The next time I touch it, I would like it to move back to its original position. So it should move from one position to the next each time I touch.
Here are the basics:
When an actor receives a Touch Inside{
-Save its position (because I am going to move it back to the original position when it is touched again)
-Move To the new position}
If the actor is in new position{
-Set the next target position (saved above in the When Touch Inside)
-Save the current position (to be able to move back after the next move)}
It basically works the way I want. It toggles back and forth from one positon to the next. But occasionally (maybe once out of every ten times) and unpredictably after it makes a move, it resets to the position it held before the most recent touch.
Are there problems with "Move To"? I am not certain that this is a bug. I have been working with this for less than a week, so the problem may definitely be at the keyboard.
Any advice is appreciated.
Thanks,
Aaron
Best Answers
-
jonmulcahy Posts: 10,408Use interpOlate instead, it's 1000x more accurate, especially for something as basic as moving back and forth.
-
gyroscope I am here.Posts: 6,598HI @RMS Aaron
As Jon @jonmulcahy says, interpolate is fine for moving stuff...
As for Move To behaviour, I've a theory which has yet to be proved conclusively one way or the other: as long as the coordinates are whole numbers in this behaviour, there shouldn't be any problems...
----------------------------------------------
http://davidgriffinapps.co.uk/""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Answers
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS