Hey all, math in scripting is unarguably really confusing for beginners. I’ve only been learning how to script for three months and have pretty much intentionally been avoiding math in my scripts. How do I learn, or at the very least, get familiar with it? This includes functions and when to do certain things? Sorry for the wordiness but it’s something that has been really REALLY challenging for me!
Even through watching the, “developer gurus” of Youtube, it really hasn’t helped me all that much. If somebody can get me a resource, a guide, or a simpler way to understand, that would be more than appreciated!
Example script my friend sent me:
local function isStandingOn(position, brick)
local v3 = brick.CFrame:PointToObjectSpace(position)
return (math.abs(v3.X) <= brick.Size.X / 2) and (math.abs(v3.Z) <= brick.Size.Z / 2) and (v3.Y >= 0)
end
(That was for his swordfighting game lol, I can send script if anybody is interested!)
That’s really helpful. Just letting you know, I’ve never really been amazing at math in real life. So I’m expecting quite a learning curve, any tips or important things I should know before getting into math?
I’m not the best when it comes to complex mathematics either.
Make sure to test out your mathematical equations, practice to get the hang of it, make sure your equations work correctly, if your equations fail check to see if there are any errors in the output, if all goes wrong you can ask for help on the DevForum.