Page 1 of 1

[Solved] Trying to make a simple platformer

Posted: Sun Feb 10, 2013 4:09 pm
by bramblez
Hello everyone, I am trying to make a platformer game and I was watching goature's tutorial videos about making one and I followed his every step, except I've tried to make my own menu too. I keep getting this same error all the time
"attempt to call field 'clamp' ( a nill value )"

what am I doing wrong?

Re: [Not solved] Trying to make a simple platformer

Posted: Sun Feb 10, 2013 4:57 pm
by Saegor
i guess you use a libray wich use another library that is not present in your game

math.clamp is something provided by a lib that miss but i don't remember the name

let me search a bit ;)

EDIT 1: mmh... camera...

EDIT 2 : it works if you declare a math.clamp function somewhere (in main.lua for example)

so, try to add this :

Code: Select all

function math.clamp(x, min, max)
  return x < min and min or (x > max and max or x)
end

Re: [solved] Trying to make a simple platformer

Posted: Sun Feb 10, 2013 5:25 pm
by bramblez
That helped! thanks alot! :)

Re: [Solved] Trying to make a simple platformer

Posted: Thu Mar 21, 2013 2:52 pm
by davisjl1979
I'm having the same problem. I'm using the followinghttp://www.explodingrabbit.com/forum/en ... -03-0.717/ and my code is an exact match to his but I'm getting the same error as OP.