FastCast projectile ricochets through parts at certain angles

*Video: Watch FastCast projectile going through parts | Streamable

  1. What do you want to achieve?
    For the FastCast projectile to ricochet off the wall instead of going through it.

  2. What is the issue?
    FastCast projectile ricocheting through parts at certain angles.

  3. 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
2 Likes