Multi-Resolution Game Development With GameBuilder Studio Check it out!
NEW Version 0.9.7 has arrived! New Blazing Fast Particle Engine & More Game Actions. Check it out
Clamp position
  • Hello, can i get some help in clamping an objects position?
  • 1 Comment sorted by
  • @Isak clamping a value can be done via an expression. There is a clampToRange helper method available that allows you to pass in a currentValue and a min and max value that you want your passed in value to stay within. If the value passed in moves outside the range of the min or max the helper method will replace the value with either the min or max. Whichever one is closer to the passed in value.

    clampToRange( 200, 0, 100) would result in a value of 100 because 200 is above the max of 100,

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion