Jump to content

What happen to the clamps ?


Alienhead
 Share

Recommended Posts

 

local number = 10
number = math.clamp(number,1,5)

Errors out, 

The the docs read - This function clamps a number between a minimum and maximum limit and returns the result.

Even the standard lua call errors on me.  Math.Clamp () /  math.Clamp() / math.clamp() 

 

or simply:     ??

 

function math.clamp(numb, min, max)

   if numb <  min then return min
   elseif numb > max then return max
   else return numb end

end

 

Link to comment
Share on other sites

  • Alienhead changed the title to What happen to the clamps ?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...