Move To, Speed

TheGabfatherTheGabfather Member Posts: 633
edited June 2012 in Working with GS (Mac)
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!

Answers

  • TheGabfatherTheGabfather Member Posts: 633
    Hey thanks @tshirtbooth !
    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?
  • MetzoPainoMetzoPaino Member Posts: 195
    Hey thanks @tshirtbooth !
    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?
    This might help:

    http://forums.gamesalad.com/discussion/44973/unstable-actor-when-idle#latest
  • TheGabfatherTheGabfather Member Posts: 633
    Thanks for the link @MetzoPaino
    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.
  • ORBZORBZ Member Posts: 1,304
    edited June 2012
    The micro jiggle is caused by the physics engine as computations near 0 but never reach it. To stabilize the micro motion you can do 1 of two things:

    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.
  • part12studiospart12studios Member Posts: 620
    I know this is an old thread, but this just came out and wanted to share this with anyone looking for a great solution.. http://forums.gamesalad.com/discussion/comment/416497#Comment_416497 @ericzingeler made an elegant suggestion in a nutshell saying to have a rule that when below a certain x / y linear velocity do...

    Move behavior with:

    Move Type: stacked
    Speed: 0

    worked like a charm and way less overhead than a bunch of constraints and rules..
  • TheGabfatherTheGabfather Member Posts: 633
    edited August 2013
    @part12studios my OP in this thread was probably within my 1st 10 posts in the forums :D

    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! :D
  • ericzingelerericzingeler Member Posts: 334
    @TheGrabfather

    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.
  • TheGabfatherTheGabfather Member Posts: 633
    @ericzingeler, yeah all that's what I was talking to @part12studios about :) I already have your project labeled and archived in my computer for future reference :D such is my practice whenever I come across amazing tricks and fixes in the forums.

    Keep up the good work and thanks for always sharing!
Sign In or Register to comment.