I want to play an effect on the opposite direction of how a raycast hit the wall.
The particles are going in a completely different direction than the opposite of the wall, hitting a wall like
.> |
makes the particles go
^ |
instead of
< |
This is what I have for my script, it plays the particles just in the wrong direction.
-- part.Impact has 2 particles that play later.
-- Impact is also an attachment.
local target = result.Position
local ImpactEffect = part.Impact:Clone()
ImpactEffect.Parent = result.Instance
ImpactEffect.WorldCFrame = CFrame.new(result.Position, result.Position + result.Normal)
* part.Impact has 2 particles that play later.
* Impact is also an attachment.
local target = result. Position
local ImpactEffect = part.Impact:Clone)
ImpactEffect.Parent = result.Instance
* Calculate the opposite direction local oppositeDirection = result.Position - result.Normal
* Set the WorldCFrame to the opposite direction
ImpactEffect.WorldCFrame =
CFrame.new result.Position, opposite Direction)