I want to learn advanced mathematical functions so I can create more epic small projects.
I am not sure if I should start learning them before even starting trigonometric functions in school.
Also, I wanted to ask what math. function I could use to rotate for example pet so they will look at the mouse. I know CFrame will be used there but- yeah.
I am so sorry if I should not ask this kind of question here.
Have a great day and stay safe!
Mhm but my question is, if it is a good idea starting to use them in programming and learn them even if I did not start in school any advanced mathematical function.
it all depends if you want to learn it when i learned these advanced math functions i was pretty smol so you can learn them math functions if you WANT to learn it
the hyperbolic functions of sine and cosine are kinda useless but the hyperbolic tangent is useful for mapping values to a range of 1 to -1 with a sigmoid curve. atan2 is basically the arc tangent but its for 2 vectors (usually used in 3d games)
You should dabble your head into shaders, that will teach you lots about how computer graphics work, how rays work on a fundamental level and how to use matrix multiplication
Regarding your initial position you want to apply a lookat matrix to the mouses 3d position and the pets position. Now thats simple since boblox corp has it built-in, it’s just like
game:GetService("RunService").Heartbeat:Connect(function()
local mouse = game.Players.LocalPlayer:GetMouse()
pet.CFrame = CFrame.new(pet.Position, mouse.Hit.Position)
end)