I Wanna Community

"clamp" code not working?

0 Members and 1 Guest are viewing this topic.

MatthewRPG

"clamp" code not working?
« on: October 18, 2016, 03:07:58 PM »

this is so strange to me because this code was working, but whenever i moved to a new pc it suddenly stopped working. any ideas for help?
EDIT: since no one is responding, can someone just give me code to replace clamp?
« Last Edit: October 20, 2016, 11:12:54 AM by MatthewRPG »

Offline Lulu49_

  • 2
  • OS:
  • Windows 10 Windows 10
  • Browser:
  • Chrome 58.0.3029.110 Chrome 58.0.3029.110
  • Playstyle: Keyboard
Re: "clamp" code not working?
« Reply #1 on: April 28, 2018, 12:28:02 PM »

this is so strange to me because this code was working, but whenever i moved to a new pc it suddenly stopped working. any ideas for help?
EDIT: since no one is responding, can someone just give me code to replace clamp?

If you have gamemaker 8.1 or gamemaker 8.0, the "clamp" code does not work... but you can still make a code to replace it, here is the code :

Code: [Select]
min = 0 //remplace 0 by the minimum value
max = 10 //remplace 10 by te maximum value
val = speed //remplace speed by the value you want to clamp

if val < min
{
      val = min
}

if val > max
{
      val = max
}
« Last Edit: April 28, 2018, 12:49:38 PM by Lulu49_ »