About Maths and apply it on scripting

Hello, we all know that maths are fundamental when coding, but some times it gets hard and confusing, some times i pass all the day searching for scripting and math tutorials, and that stuff, but i would like to know what methods, or what to learn for undestand it 100%, like what kind of maths should i learn, and how can i apply it when scripting, i would like to make like blood drops, but the drop rotating and facing depending if it’s on a wall, or floor.

1 Like

You need have good understanding about what vectors is, and you better have good math database in head so you can not lost day for searching some thing but just write it. For this blood how i understand you need use raycast which returns HitObj,HitPos,HitNormal,HitMaterial and you need use hit normal, normal of vector that’s 90 degrees vector which goes from surface and also you need good know what cframes is so you eazy can do small formula like this BloodPart.CFrame = CFrame.new(HitPos,HitPos+HitNormal)

1 Like

Hello, i tried it before, but about that i have a doubt, why when you do this: CFrame.new(HitPos,HitPos+Normal), what is “Normal” and why did you add Normal to HitPos?

This post offers a good explanation of the vectors.

1 Like

Often, using trigonometry is helpful when you want to deal with rotation and physics problems

1 Like

I know some trigonometry, but do you have like some examples?

If you want to create waves, you can often use sine waves to achieve it

If you want to move a part at a certain angle, and at a certain distance, you could use sine and cosine to find the position.

If you want to create a placement system and you want to save the rotation, you can use the CFrame LookVector with tan^-1 to find the orientation.

2 Likes