Skip to content

Properties

To access properties, you first need to require the module:

local HomingCast = require(.../HomingCast)

Then, create the properties:

local Properties: {} = HomingCast.NewProperties()

Can I create more Properties?

Yes, you can! This can be useful for different scenarios. For example, if your spell hits something and creates sub-spells, you can create additional properties to give them different behaviors

There are a lot of properties and they all are listed here!


MaxDistance

Properties.MaxDistance :: number
If the cast covers this distance, it will be terminated

Terminated!

This will fire:

Caster.Terminated(InfoCast, Reason: string, CosmeticBullet: BasePart?, UserData: {})
The Reason will be "MaxDistance"


MaxFlyTime

Properties.MaxFlyTime :: number
If the cast flies longer than this value, it will be terminated

Terminated!

This will fire:

Caster.Terminated(InfoCast, Reason: string, CosmeticBullet: BasePart?, UserData: {})
The Reason will be "MaxFlyTime"


RotationSpeed

Properties.RotationSpeed :: number
Defines the speed at which the cast turns


RaysPerMove

Properties.RaysPerMove :: number
Determines how many raycasts will be fired in one move.

Performance Warning!

Setting this value too high (e.g., 20 or more) can cause significant lag

Recommended values range from 1 to 5


MaxAngleToLoseTheTarget

Properties.MaxAngleToLoseTheTarget :: number
If the target moves outside this angle, the cast will lose track of it


SimulateBeforePhysics

Properties.SimulateBeforePhysics :: boolean
If true, the projectile will be simulated before physics calculations (Optional)


RayCastParams

Properties.RayCastParams :: RaycastParams
Defines the RaycastParams for the cast (Optional)


CosmeticBulletFolder

Properties.CosmeticBulletFolder :: any
The folder used to contain cosmetic bullets


CosmeticBulletTemplate

Properties.CosmeticBulletTemplate :: any
The cosmetic bullet itself


Prediction

Properties.Prediction :: boolean
If false, target prediction is disabled. If true then module will predict the target's future position based on its velocity and position


Trajectory

Properties.Trajectory :: {}
If not nil, the projectile will attempt to follow the given trajectory. (Optional)

For more information, see Custom Trajectories.

Example

Properties.Trajectory = {
    {["Yscale"] = 0.7392795883361921, ["Xscale"] = 0.1490480939713951, ["State"] = "Free"},
    {["Yscale"] = 0.7438536306460835, ["Xscale"] = 0.7176853600471377, ["State"] = "Free"},
    MaxHeight = 200
}

HighPrecision

Properties.HighPrecision :: number
If this value is greater than 0 (e.g., 0.1, 0.2, 0.3, ..., 1), the module will perform a secondary accuracy check after a low-fidelity raycast detects a hit. This value determines how precise the recalculations will be. (Optional)

HighPrecision Example

Performance Warning!

Setting this value to extreme small numbers (e.g., 0.01 or smaller) can cause significant lag

Recommended values range from 0.1


Offset

Properties.Offset :: (TotalTime: number, DeltaTime: number, TargetPosition: Vector3, CurrentPosition: Vector3) -> (Vector3)
This function affects the target's position

Example

Properties.Offset = function(TotalTime, DeltaTime, TargetPosition, CurrentPosition)
    return Vector3.new(0, 10, 0)
end
The projectile will fly above the target's actual position

How does Offset work?

TargetPosition += Offset(TotalTime, DeltaTime, TargetPosition, CurrentPosition)

Scaler

Properties.Scaler :: (TotalTime: number, DeltaTime: number, TargetPosition: Vector3, CurrentPosition: Vector3) -> (Vector3 | number)
This function affects the target's position

How does Scaler work?

TargetPosition *= Scaler(TotalTime, DeltaTime, TargetPosition, CurrentPosition)

Remember!

First, the target's position will be scaled, and then an offset will be applied

TargetPosition = TargetPosition * Scaler(...) + Offset(...)


UserData

Properties.UserData :: {}
Stores custom data