I’ve been forking the Roblox default FPS System to make a different fps game-- new viewmodel, animations, effects, weapons.
I’ve had success to import a new viewmodel along with animations, sounds, a custom sprinting system and new vfx for muzzle flash and hit impact but how the Roblox default FPS System uses a weird laser tween for their bullet effect I can’t seem to figure out how to edit it so it looks like a actual bullet (image below) – I’ve also tried using FastCast to simulate projectiles but to no avail.
draw_rayResults Module
--- LASER BEAM EFFECT MODULE IS THE ONE RESPONSIBLE FOR THE LASER TRACER EFFECT
local castRays = require(script.Parent.castRays)
local laserBeamEffect = require(script.Parent.Parent.Effects.laserBeamEffect)
local impactEffect = require(script.Parent.Parent.Effects.impactEffect)
local function drawRayResults(position: Vector3, rayResults: { castRays.RayResult })
for _, rayResult in rayResults do
laserBeamEffect(position, rayResult.position)
if rayResult.instance then
impactEffect(rayResult.position, rayResult.normal, rayResult.taggedHumanoid ~= nil)
end
end
end
return drawRayResults
laserBeamEffect Module
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local Workspace = game:GetService("Workspace")
local Constants = require(ReplicatedStorage.Blaster.Constants)
local laserBeamTemplate = ReplicatedStorage.Blaster.Objects.LaserBeam
local function laserBeamEffect(startPosition: Vector3, endPosition: Vector3)
local distance = (startPosition - endPosition).Magnitude
local tweenTime = distance / Constants.LASER_BEAM_VISUAL_SPEED
local tweenInfo = TweenInfo.new(tweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
local laser = laserBeamTemplate:Clone()
laser.CFrame = CFrame.lookAt(startPosition, endPosition)
laser.StartAttachment.Position = Vector3.zero
laser.EndAttachment.Position = Vector3.new(0, 0, -distance)
laser.Parent = Workspace
local tween = TweenService:Create(laser.StartAttachment, tweenInfo, { Position = laser.EndAttachment.Position })
tween:Play()
tween.Completed:Once(function()
laser:Destroy()
end)
end
return laserBeamEffect
The bullet model I’m trying to use instead of the default Roblox laser:
Problem GIF:
https://gyazo.com/08025a2d3c0464b88dcc9963b7ba0d73 (uses slightly different edited laserBeamEffect module)