When I said “be specific”, I meant to run through exactly what you’re doing.
When you tell me “(thing) is broken”, that’s basically like going to a restaurant and telling the waiter “I want food”. Yes, I know that. You have to actually give me information about what it is that you’re doing, otherwise everything you’ve told me ends up being worse than useless.
What are you trying to do? What does the code look like? How are you using the function? Be specific and complete.
So I’m using the pierce function to pierce through humanoids that are already killed (so dead bodies can’t block bullets). Basically, if the health <= 0 then it returns true and pierces the body.
The problem is I keep getting this warning every time the bullet hits a “dead body” part.
WARNING: Exceeded maximum pierce test budget for a single ray segment (attempted to test the same segment 100 times!)"
Do you know why this might be and/or how to stop it? I’m assuming it keeps hitting the same part but wouldn’t the ray already be incremented forward by one increment already?
For reference, I don’t have a OnRayPierced function attached. If it does pierce, it doesn’t do any modifications such as bouncing. Also, the raycast filter is on a Whitelist.
I take it you’re using the part cache module that comes with it right? I also take it you’re using trails for the bullet to make a bullet tracers? So basically, what you could do is disable the trail when it’s in the cache. When you fire a bullet, wait until the bullet actually comes down to the gun, and then enable the trail. So the trail doesn’t “come from the sky”.
local FastCast = require(script.FastCastRedux)
FastCast.VisualizeCasts = true
local caster = FastCast.new()
local origin = workspace.TEST.FirePoint.WorldPosition
local direction = workspace.TEST.Orientation
caster:Fire(origin, direction, 10)
I’ve tried different values and nothing seems to work. The only thing that I know is that the VisualizeCasts’ CFrame is NAN (huge number). This script is under workspace. Everything looks like it’s working but it doesn’t visualize it correctly.
Am I missing something from the documentation?
EDIT : I figured out that the direction Vector3 was not giving the correct values. To go around this I made an attachment point and made it face the direction that I wanted to shoot using the WorldAxis to get the Vector3. Is there a way to get the Vector3 of a part the gives the same Vector3 as the attachment?
EDIT 2 : I found out that I need the LookVector. This took way longer then it should have.
soo piercing is confusing for me. Not much documentation on the github for it, so I’m kinda at a loss of how to implement it. Whenever the pierce function fires, I check for a humanoid. If it detects a humanoid I call my damage function to calculate damage and do a bunch of checks. mind you my damage function DOES NOT yield whatsoever. But whenever I try calling it from the pierce function, the module returns an error about taking too long to complete. I’m probably over looking something, but at the moment I don’t know where to look for answers besides here. Originally, I thought it was my damage function, but after thoroughly checking it for any possible yielding or errors, I realized that surely was not it.
That error will occur if your pierce handler has not returned by the time the next ray simulates, which means that it was still trying to process that pierce operation when it was ready to move on.
Hello, I just have to say that I love this module. One question though, is it possible to make the velocity of the projectile be zero while it’s in the air? for example if I cast the projectile and then press a button, then the projectile stops mid air until I press that key again, is there any way to do that or is that not a feature yet?.
Hi, I’m using FastCast for a tennis game I’m working on, and I’ve noticed that whenever FastCast spawns an object, it increases the network receive rate a lot. (7-10 kbps per ball spawned)
Do you know what may be causing this?
I’m using a replication method that replicates the position and velocity of the ball every time it’s hit on the server (remote event fire to every client available to update their client cast), but even when I disable that, I noticed that the network data incoming rate (specifically Data) is unusually high.
In the API there is a Pause() and Resume() for an ActiveCast, when you do Caster:Fire() it returns an ActiveCast, so you’d have to maybe pool all active casts in a table, they delete themselves when the bullet hits so might work.
You should always elaborate on the conditions and provide code. It’s a lot like calling me and asking for my help, and then putting me on hold once I ask what the issue is. Now I gotta wait on you to tell me the issue, and then maybe I can start being productive and working on an answer. Wastes both of our time.
Caster.LengthChanged:Connect(function(Cast, LastPoint, Direction, Length, Velocity, Bullet)
if Bullet then
if (LastPoint - NewTower.TurnPart.Position).Magnitude <= (TowerSheet.TowerShootingRange[TowerListNumber] / 2) then
local BulletLength = Bullet.Size.Z / 2
local Offset = CFrame.new(0, 0, -(Length - BulletLength))
Bullet.CFrame = CFrame.lookAt(LastPoint, LastPoint + Direction):ToWorldSpace(Offset)
else
Cast:Terminate()
print("Ray Terminated for out of range!")
end
end
end)
My goal is to terminate the cast once it gets out of range.
Correct me if I’m wrong but in the FastCast API it says that you can set a max distance using FastCastBehavior.MaxDistance and it will automatically terminate the projectile when it goes out of range.