Hey! I’m trying to make permanent spike strips, that only work from one way (one side). In other words, if you drive onto it from the front (for example), it won’t do anything, if you drive onto it from the back, it will pop your tires.
The spike strips functionality itself works, thats fine, it’s just the checking for the way (side) they went from.
Currently it’s using angle maths, but it doesn’t work very well, cuz the angles change a lot, so it’s not that easy to make a corresponding value for each way. (ignore the < 20 value, I was just experimenting around with numerous numbers, though nothing seemed to work perfectly)
local Facing = hit.Parent.Parent.DriveSeat.CFrame.LookVector
local Vector = (v.Position - hit.Parent.Parent.DriveSeat.Position).unit
local Angle = math.acos(Facing:Dot(Vector))
print("math.deg(Angle): "..math.deg(Angle))
if math.deg(Angle) < 20 then
Forgot to mention: “hit” is an individual vehicle wheel, and “v” is a specific spike strip