Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What variable/function do I use to get a part’s angle?

I’m a beginner scripter and I am attempting to create ballistics in roblox with shells and armor. I was just wondering what function I can use to get a part’s angle. This will be used in a sense that if a projectile hits an armor plate at a shallow angle (15° or less), the projectile will ricochet.

I know this is completely wrong but I did a short script for an example.

local hitAngle = ***

if hitAngle < 15 then
script.Parent.CanCollide = true

Now in the “***” area, I need to know what function I can use to get a part’s angle when it hits a brick.

1 comment

0

this is a very good question

1 answer

this is avery good question,the answer is:

local hitAngle = script.Parent.Orientation.Magnitude
if hitAngle >= 15 then
script.Parent.CanCollide = true

1 comment

0

What I meant was get the part’s hit angle compared to the surface it hit

This discussion is preserved as it was. New answers, comments, and votes are closed.