Hello all, I have been trying to make a wall collision script. This script works well and does do what I want except orientation.
The issue is that I cant get the orientation of the “Wall” and put it into the smash VFX. And it doesn’t cause a error so I have no idea what to do now.
I’ve looked for many solutions yet they all come out the same. Maybe I’m just missing something but I can’t quite figure this out. First post btw 
Any Help is greatly Appreciated!
local wallsFolder = game.Workspace.Walls
local wallHit = false
local ts = game:GetService("TweenService")
for i,v in pairs(wallsFolder:GetChildren()) do
v.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local eHum = hit.Parent:FindFirstChild("Humanoid")
local eTorso = hit.Parent:FindFirstChild("Torso")
local eLarm = hit.Parent:FindFirstChild("Left Arm")
local eRarm = hit.Parent:FindFirstChild("Right Arm")
local eLleg = hit.Parent:FindFirstChild("Left Leg")
local eRleg = hit.Parent:FindFirstChild("Right Leg")
local eHead = hit.Parent:FindFirstChild("Head")
if eTorso:FindFirstChild("BodyVelocity") and wallHit == false then
wallHit = true
local smashFX = game.ReplicatedStorage.Smash:Clone()
local material = v.Material
**local orientY = v.Orientation.Y**
local color = v.BrickColor
local info = TweenInfo.new(
1,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0,
false,
0
)
local goals = {
Size = Vector3.new(15.561, 1.615, 15.592);
Transparency = 0;
}
local twen = ts:Create(smashFX, info, goals)
smashFX.BrickColor = color
smashFX.Material = material
smashFX.Parent = game.Workspace
smashFX.CanCollide = false
smashFX.Position = eTorso.Position
**smashFX.Orientation = Vector3.new(0, orientY, -90)**
twen:Play()
smashFX.Anchored = true
local vel1 = eTorso:FindFirstChild("BodyVelocity")
local vel2 = eLarm:FindFirstChild("BodyVelocity")
local vel3 = eRarm:FindFirstChild("BodyVelocity")
local vel4 = eLleg:FindFirstChild("BodyVelocity")
local vel5 = eRleg:FindFirstChild("BodyVelocity")
vel1:Destroy()
vel2:Destroy()
vel3:Destroy()
vel4:Destroy()
vel5:Destroy()
wallHit = false
wait(9)
end
end
end)
end