Move To, Speed
TheGabfather
Member Posts: 633
Hi guys, sorry if this is a recurring question. I'm still finding it difficult utilizing the site Search.
Right now I'm making a simple menu system where when I touch a button it activates a Move To behavior, and the camera follows that button/actor (to the next part of the menu).
Whenever I set the speed to >500 I get a script error, but 500 is just too slow for me. Is there any way to bypass this speed limit or a better method of executing what I want to happen?
I've tried working with Linear Velocity but I'm still puzzled on how to make it stop at a certain coordinate. I'm trying to avoid Timers as well.
Thanks, I'll really appreciate any help that might come my way
I've been developing for the Windows Phone and Android for about a year now, but thanks to GS and its awesome community I can't wait to start releasing games for the iOS. And at probably a fraction of the time as well!
Right now I'm making a simple menu system where when I touch a button it activates a Move To behavior, and the camera follows that button/actor (to the next part of the menu).
Whenever I set the speed to >500 I get a script error, but 500 is just too slow for me. Is there any way to bypass this speed limit or a better method of executing what I want to happen?
I've tried working with Linear Velocity but I'm still puzzled on how to make it stop at a certain coordinate. I'm trying to avoid Timers as well.
Thanks, I'll really appreciate any help that might come my way
I've been developing for the Windows Phone and Android for about a year now, but thanks to GS and its awesome community I can't wait to start releasing games for the iOS. And at probably a fraction of the time as well!
Answers
That actually also solved a random script error that I'd encounter every now and then.
However it's causing my actor to shake a lot :-< Is that normal?
http://forums.gamesalad.com/discussion/44973/unstable-actor-when-idle#latest
I think that thread highlights a more serious problem.
Mine's simply, the actor (which controls the camera) shakes a lot while moving, but stops completely once it reaches the destination after interloping. I was hoping of making the movement smoother.
If the actor doesn't use physics set its movable flag to false. You can still programmatically move it, but the physics engine will ignore it for calculations. Caution though: two non movable actors will never detect collision with each other as the engine assumes non movable actors can't collide.
The other option is to leave movable checked but issue a Move behavior with the speed set to 0. This will nullify all linear velocity. You may also need to nullify angular velocity depending on your actor. Use change attribute for that.
Keep in mind that if your movable actor is in collision with something it can bounce off of, such as a floor, then setting movement speed to 0 will have no effect as the very next cycle will start the bouncyess again.
Move behavior with:
Move Type: stacked
Speed: 0
worked like a charm and way less overhead than a bunch of constraints and rules..
But anyway thanks for adding another solution. I haven't used Move and Move To ever since, and it was probably because of this thread. In the future when applicable I'll give @ericzingeler's project a try. He's been sharing a buttload of awesome tricks here and there, I have no doubt the one you shared here won't be an exception
edit: after reading through that thread entirely, I now know a bit more about Additive and Stacked. Cheers!
The only time I ever used move was to stop an actor, until now. Check out the project in this thread I posted yesterday:
http://forums.gamesalad.com/discussion/comment/416497#Comment_416497
There's also an explanation as to why the move stacked option isn't ideal.
Keep up the good work and thanks for always sharing!