*Video: Watch FastCast projectile going through parts | Streamable
-
What do you want to achieve?
For the FastCast projectile to ricochet off the wall instead of going through it. -
What is the issue?
FastCast projectile ricocheting through parts at certain angles. -
What solutions have you tried so far?
Looking at other DevForum posts, but it seems no solution worked for me under the posts I viewed. I’ve also tried positioning things around to see if it changes, but it seems there are none. I am very lost on what to do.
By the way, I am using BlackShibe’s open-source FPS framework and the latest FastCast module.
function OnRayPierced(cast, raycastResult, segmentVelocity, cosmeticBulletObject)
local newNormal = segmentVelocity.Unit - (2*segmentVelocity.Unit:Dot(raycastResult.Normal)*raycastResult.Normal)
cast:SetPosition(raycastResult.Position)
cast:SetVelocity(newNormal * segmentVelocity.Magnitude)
end