can i converte negative speed/velocity into positive?

guillefaceguilleface Member Posts: 1,014
edited November -1 in Working with GS (Mac)
i have a rule for my ball actor to constrain self position to hole position when overlapping with the hole and also when velocity is less than 300, so when the ball is going from left to right and top to bottom it does works, but when the ball is going right to left the speed is in negative which trigger the rule because negative 400 is less than 300 but the ball is actually going on 400 speed, how can i solve this problem guys?

Comments

  • guillefaceguilleface Member Posts: 1,014
    thanks tshirtbooth is working now
  • guillefaceguilleface Member Posts: 1,014
    never mind tshirtboot is not working,
  • calvin9403calvin9403 Member Posts: 3,186
    make an attribute pos? bool, true

    when your speed is greater then 0 change pos to true

    when your speed is less then 0 change pos to false

    when pos is true and speed is greater then 0, ....

    when pos is false and speed is less then -300, ...
  • guillefaceguilleface Member Posts: 1,014
    hi calvin thanks for trying helping me but can you be more clear to how set the rules like together or separates each other? i try working with a boolen but still have the same problem.
  • ID13ID13 Member Posts: 6
    edited March 2012
    Hi Folks,

    I am struggling to connect the constrain code with speed or tilt of accelerometer. What i am trying to do is give the effect that if actor A moves over actor B it falls into it but is not destroyed, but will come out again if the iPad/iPhone is titled enough..

    Appreciate any pointers many thx.
Sign In or Register to comment.