playMaker

Author Topic: I CAN'T limit the position of object!  (Read 1978 times)

sangh518

  • Playmaker Newbie
  • *
  • Posts: 2
I CAN'T limit the position of object!
« on: May 09, 2016, 03:25:58 AM »
hello
i sorry that im not english speaker, so my english is bad

im making some mobile pong game, and i use [touch info] and [translate] to move paddles.
And i use [get position] - [float clamp] - [set position] to limit the movement of object.
it actually works. Paddles have limit to move.
But when i bulid and run, when paddles move, paddles move over the limit at very short time, and come back to limit position. it makes movement very dirty, looks like bug.
The most strange thing is some pabbles are stop at limit immediately! even the FSM is exactly same!

im fighting with this problem all day long, and it make me crazy...
please help me!
« Last Edit: May 09, 2016, 04:42:52 AM by sangh518 »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: I CAN'T limit the position of object!
« Reply #1 on: May 09, 2016, 05:23:50 AM »
Hi,
i had the same problem in an old project of mine,
i made a quick video on how i solved it.
i hope it can help you.


sangh518

  • Playmaker Newbie
  • *
  • Posts: 2
Re: I CAN'T limit the position of object!
« Reply #2 on: May 09, 2016, 06:34:10 AM »
Thanks for your kindness!!

my pong game is using delta X, Y to be able to move pabble at everywhere on screen, so it was little different problem with your solution.

Anyway, i'm interesting in your ball FSM. i don't know how to make ball bounce, so i set vector2D, and set event, when collide vertical, multifly -1 at X, and else Y. but it doesn't looks good. How did you make ball movement?