Effect on opposite direction raycast hit wall

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)
1 Like

* 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)

1 Like

I tried to understand what you did but it didn’t work, the particles still go upward.

1 Like

When I was making my particle I duplicated my existing particle and forgot to change EmissionDirection to “Front” so it was still on “top”.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.