playMaker

Author Topic: how to make clamp translate ??  (Read 3135 times)

shsha

  • Playmaker Newbie
  • *
  • Posts: 8
how to make clamp translate ??
« on: June 14, 2011, 10:16:44 AM »
hello .....
 i`m learning playmaker & i`m making a simple 2d game .... i`m trying to move a space ship in X & Y
so im uesing 2 actions with the space ship ... 1- Get Axis     2- Translate\
but i` wana add clamp ... so i`m useing Float Clamo from Math
but it`s not working ........
i wana know how to make clamp translate..

thanx

tofusoup

  • Playmaker Newbie
  • *
  • Posts: 30
Re: how to make clamp translate ??
« Reply #1 on: June 14, 2011, 12:39:59 PM »
This might help you think how to set up the FSM.

First detect the position of your character (For example I want to limit the Y movement)
If it reaches the max or min value send it to the appropriate state (High Low state)
Then use Float Clamp to clamp a variable of the Y value of your character (every frame)
Then use Set Position again, using that variable (every frame) to lock the character in the high or low value you set

Sorry I'm not at my workstation so I just typed it up.  See if this helps.