Skip to content

CastStateInfo

Internal Class

This is an internal class intended to be used by FastCast itself, and should not be edited by you in any way. Changing any of these properties will cause ray simulation to completely break.

A CastStateInfo contains the information that the ActiveCast uses to keep track of where it is.



Properties


RBXScriptSignal UpdateConnection

The underlying RBXScriptSignal that is connected to one of RunService's update methods to update this ActiveCast.


number HighFidelitySegmentSize [ = 0.5 ]

If HighFidelityBehavior is not Default, then the size of raycast segments is enforced to be as close to this value as possible where applicable (see HighFidelityBehavior for more). Instead of creating a cast with a length based on the amount of time that it took to calculate and using that value itself, it will instead split that value into pieces that are this many units long. This can be used to ensure hit detection accuracy for physics simulations. This is useless for non-physics casts, and will not do anything if the cast's acceleration is a zero vector.


number HighFidelityBehavior [ = 0 ]

The method in which FastCast handles physics cast accuracy. This is useless for non-physics casts, and will not do anything if the cast's acceleration is a zero vector.

  1. Default - FastCast will behave as it normally does, and use a segment length based on delta time.
  2. OnlyWhenHit - Similar to Default, but if a segment registers a hit, it will recalculate that hit to see if it really should have hit. This has a drawback that may make it undesirable for extreme precision scenarios (click to see).
  3. Always - FastCast will always enforce that the segment length is as close to HighFidelitySegmentSize no matter what. Be careful to not cause exponential cast lag (see HighFidelitySegmentSize).

boolean Paused

Represents whether or not this ActiveCast should be simulating. If true, the cast will freeze and not simulate any physics data.


number TotalRuntime

The amount of time that this cast has been running for in seconds.


number DistanceCovered

The amount of distance that this cast has traveled.


boolean IsActivelySimulatingPierce

An internal value used to determine whether or not the system is calculating a pierce.

boolean IsActivelyResimulating

An internal value used to determine whether or not the system is recalculating a physics-based cast with a higher resolution than normal.

boolean CancelHighResCast

An internal value used to determine whether or not to cancel the simulation of a high resolution cast recalculation. This is required in case someone uses the pierce function to make a ricochet or other behavior that redirects the bullet.


CastTrajectory[ ] Trajectories

An array of CastTrajectory objects that represent a specific section in time of simulation. A new instance of this object will be added to this list whenever a method that can change the behavior or motion of the projectile is called.