The issue: I want to make the abilities go to the mouse position, however the mouse 3d position gets on the invisible barrier stuff, is there a way i can ignore certain parts when raycasting the mouse or smth?
the barriers and the camera angle:(The camera is locked isometric)
The mouse position works fine without the barriers
The code:
local mouse = player:GetMouse()
local mousePos = Vector3.new(mouse.Hit.X, torso.Position.Y, mouse.Hit.Z)
local lookDirection = (mousePos - torso.Position).Unit
torso.CFrame = CFrame.new(torso.Position, torso.Position + lookDirection)
local rocket = rocketTemplate:Clone()
rocket.CFrame = torso.CFrame * CFrame.new(0, 0, -2)
local bodyVelocity = Instance.new("BodyVelocity")
bodyVelocity.MaxForce = Vector3.new(100000, 100000, 100000)
bodyVelocity.Velocity = lookDirection * ROCKET_SPEED
bodyVelocity.Parent = rocket