Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 4 years ago

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.

0
this is a very good question gloveshun 119 — 4y

1 answer

Log in to vote
0
Answered by
gloveshun 119
4 years ago
Edited 4 years ago

this is avery good question,the answer is:

local hitAngle = script.Parent.Orientation.Magnitude
if hitAngle >= 15 then
script.Parent.CanCollide = true
0
What I meant was get the part’s hit angle compared to the surface it hit ClassicMasterNoob 14 — 4y
Ad

Answer this question