Jump to content
Thirsty Panther

Problems with Cos/Sin/Tan

Recommended Posts

I'm having a problem getting the Cos of an angle.

My code is


local tum = Cos(Angle)


And I get the error "attempt to call global 'Cos' (a nil value)"


Things I have tried:

- Lower case c for cos

- Brackets around Cos(Angle)

- Same error occurs if I use Sin or Tan etc

- Used a script variable ie Self.tum instead of local


What am I doing wrong?

Share this post

Link to post

Also there is the same thing in Lua itself:


Be careful, the LE function takes degrees where as the built in lua function takes radians(since 4.0).

Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

  • Create New...