Hey, so I have a problem. Using this with a viewmodel, and it works fine, until I aim in. When I aim in, it hits the gun model so it stops. How can I make it go past and ignore certain models and its descendants?
I know that there’s a function for it, but I can’t find it. Mind telling me what that function is and how to use it? Thanks
Is version 13.2.1 published yet? Taking a look at the module and I don’t see PreSimulation / PostSimulation being used anywhere according to your changelogs.
So I tried out some beam work, and two beams together make it look like a super nice bullet. How do I make the fast cast use two beams with of course, two attachments, be the fire point? Or do I just seperate it to make a velocity based beam?
I can’t fully explain to you, but I can answer it.
Number 1: Yes, it can work with viewmodels, I use it for my viewmodel.
I usually do the bullets client side then do the damage on serverside, along with maybe another extra caster:Fire() on server to add those serverside bullets so people can see you shoot.
If it’s a beam and 2 attachments, Can’t you just put them inside an invisible part, And make the part the bullet? This way the attachments would also follow the part i’d assume
local BulletTemplate = game.ReplicatedStorage.Bullet:Clone() -- This will be the bullet we clone.
local CastBehavior = FastCast.newBehavior() -- put your settings here
CastBehavior.CosmeticBulletTemplate = BulletTemplate
Furthermore, You can use “CosmeticBulletProvider” If you want to use a partcache.
That’s what i meant, You’ll have to update the projectile’s CFrame, Here’s the code i used.
Caster.LengthChanged:Connect(function(Cast, LastPoint, Direction, Length, Velocity, Projectile)
if Projectile then
local ProjectileLength = Projectile.Size.Z/2
local Offset = CFrame.new(0,0,-(Length-ProjectileLength))
Projectile.CFrame = CFrame.lookAt(LastPoint, LastPoint+Direction):ToWorldSpace(Offset)
end
end)
Unsure if raycast parameters are off or what, but it doesn’t seem to filter correctly??
I get prints when the bullet hits the barrel of the gun (which is a child of “Tool”), thus it should be ignored??
local Tool = script.Parent
local Character = Tool.Parent
local Bullets = workspace:WaitForChild("Bullets")
local CastParams = RaycastParams.new()
CastParams.FilterType = Enum.RaycastFilterType.Blacklist
CastParams.IgnoreWater = true
CastParams.FilterDescendantsInstances = {
Character,
Tool,
Bullets
}
local Caster = FastCast.new()
-- Set up cast behavior
local CastBehavior = FastCast.newBehavior()
CastBehavior.RayCastParams = CastParams
CastBehavior.Acceleration = Vector3.new(0, -500, 0)
CastBehavior.AutoIgnoreContainer = false
CastBehavior.CosmeticBulletContainer = Bullets
CastBehavior.CosmeticBulletTemplate = BulletTemplate
local function OnRayHit(cast, result, velocity, bullet)
local Hit = result.Instance
print(Hit)
local HitCharacter = Hit:FindFirstAncestorWhichIsA("Model")
if HitCharacter ~= Character then
if HitCharacter and HitCharacter:FindFirstChild("Humanoid") then -- Character
HitCharacter.Humanoid:TakeDamage(100)
end
end
Debris:AddItem(bullet, 2)
end
Caster.RayHit:Connect(OnRayHit)
Is there a way to make the projectile and the end result different parts. By that I mean, can the projectile that flies through the air be a specific part, with its own specs, and then the bullet that is left on the part be a different part?? I want to use rectangle projectiles, but then have the part that sticks on the block be a ball