An ActiveCast represents a bullet fired by a parent Caster. It contains methods of accessing the physics data of this specific bullet at any given time, as well as methods to alter its trajectory during runtime.
Don't Change This!
This value is exposed so that the ActiveCast can communicate with the Caster that created it. Changing this value will cause a critical cast failure.
A reference to the Caster that created this ActiveCast from its Fire method.
A container storing information about the caster's state.
A container storing information pertaining to actual raycasting.
A table where the user can store arbitrary information pertaining to this ActiveCast. This is a generic Lua table, so you can populate it with whatever data you want (just as you would any other lua table). This is especially helpful if you need some extra data attached to bullets that doesn't come out of the box with FastCast.
Update(deltaTime) is an internal method! Manually calling it will cause simulation faults and inaccuracies in your cast.
Updates the caster and increments its internal timer forward by
Use discretion when calling any of these methods! Frequently calling these (e.g. every frame) may cause performance problems.
This creates a new CastTrajectory internally. If this is called and the current trajectory has not ticked forward yet, then this will simply modify the existing trajectory instead of making a new one. As a result, while calling this every frame or tick will cause lag, calling multiple methods at once one after the other will not.
Returns the velocity of the cast at this point in time.
Returns the acceleration of the cast at this point in time.
Returns the position of the cast at this point in time.
Sets the velocity of this cast at this point in time to
Sets the acceleration of this cast at this point in time to
Sets the position of this cast at this point in time to
velocity onto the current velocity of the cast.
acceleration onto the current acceleration of the cast.
position onto the current position of the cast.
Pause this ActiveCast, preventing it from simulating. This is identical to setting
Paused = true in
Resume this ActiveCast, causing it to simulate again. This is identical to setting
Paused = false in
Terminate this ActiveCast, disconnecting its update event and disposing of all of the data stored inside. Fires the
This method disposes of the ActiveCast. First, it executes the
CastTerminating event. Once execution completes, it will continue with the disposal process. This means that it clears out all of the data stored inside and sets its metatable to
nil. Attempting to access any information in the ActiveCast after calling this method will result in an error.