Cluster Creator Kit Script Reference
    Preparing search index...

    Interface OverlapEffectItem

    A handle for setting Overlap Effects ("effects applied to participants who touch the item") on the item. It can be accessed via ClusterScript.overlapEffect.

    While an effect is set, it is applied to participants who touch the item's OverlapDetectorShape. Participants here include not only regular participants, but also event ghosts and group viewing participants. For details, refer to About ghost participants.

    One effect can be set per kind. Each time a method that sets an effect is called, the previous effect of the same kind is replaced with the new effect. Effects of different kinds can be set in combination.

    There are two types of effects: one-shot effects and continuous effects. One-shot effects (setPosition / setRotation / respawn / addVelocity) are applied once each time a participant enters the range. When multiple one-shot effects are applied at the same time, they are applied in the order in which each effect was last set. Continuous effects (setMoveSpeedRate / setJumpSpeedRate / setGravity / setPostProcessEffects) are applied while a participant is in the range, and stop being applied when the participant leaves the range or the effect is cleared. If no other continuous effect of the same kind is applied, the value set by PlayerHandle etc. is restored. Continuous effects take precedence over settings of the same kind made by PlayerHandle or PlayerScript. When multiple continuous effects of the same kind are applied to a participant, the most recently set effect takes effect.

    Effect settings are synchronized as the item's state, and are also applied to participants who join the space later and enter the range. When a one-shot effect is set or modified, it is also applied once to participants already in the range. If one-shot effects of the same kind are set in rapid succession, some effects in between may not be applied. When a continuous effect is set or modified, it is also applied or updated immediately for participants in the range.

    If the item has no OverlapDetectorShape, no effects are applied.

    interface OverlapEffect {
        addVelocity(velocity: Vector3): void;
        clear(): void;
        clearGravity(): void;
        clearJumpSpeedRate(): void;
        clearMoveSpeedRate(): void;
        clearPosition(): void;
        clearPostProcessEffects(): void;
        clearRespawn(): void;
        clearRotation(): void;
        clearVelocity(): void;
        respawn(): void;
        setGravity(gravity: number): void;
        setJumpSpeedRate(jumpSpeedRate: number): void;
        setMoveSpeedRate(moveSpeedRate: number): void;
        setPosition(position: Vector3): void;
        setPostProcessEffects(effects: PostProcessEffects): void;
        setRotation(rotation: Quaternion): void;
    }
    Index

    Methods

    • Sets a one-shot effect that adds a velocity to participants who touch the item. The actual movement speed of the participant is determined from both the added velocity and the participant's input. While the participant is in contact with the ground, the added velocity will gradually decrease, similar to the effects of friction.

      If the velocity contains NaN, Infinity, or -Infinity, an error will occur.

      Parameters

      • velocity: Vector3

        Velocity to add (global coordinates)

      Returns void

    • Clears all effects that are set. Participants to whom continuous effects are applied return to the values set by PlayerHandle etc.

      Returns void

    • Clears the continuous effect that modifies the gravitational acceleration.

      Returns void

    • Clears the continuous effect that modifies the jumping speed multiplier.

      Returns void

    • Clears the continuous effect that modifies the movement speed multiplier.

      Returns void

    • Clears the one-shot effect that changes the position.

      Returns void

    • Beta

      Clears the continuous effect that applies PostProcessEffects.

      Returns void

    • Clears the one-shot effect that respawns participants.

      Returns void

    • Clears the one-shot effect that changes the rotation.

      Returns void

    • Clears the one-shot effect that adds a velocity.

      Returns void

    • Sets a one-shot effect that respawns participants who touch the item.

      Returns void

    • Sets a continuous effect that modifies the gravitational acceleration (in m/s^2) applied to participants in the range. When a participant leaves the range, this effect is no longer applied to the participant.

      If NaN, Infinity, or -Infinity is specified, an error will occur.

      Parameters

      • gravity: number

        Gravitational acceleration value

      Returns void

    • Sets a continuous effect that modifies the jumping speed multiplier of participants in the range. When a participant leaves the range, this effect is no longer applied to the participant.

      If NaN, Infinity, or -Infinity is specified, an error will occur.

      Parameters

      • jumpSpeedRate: number

        Jumping speed multiplier

      Returns void

    • Sets a continuous effect that modifies the movement speed multiplier of participants in the range. When a participant leaves the range, this effect is no longer applied to the participant.

      If NaN, Infinity, or -Infinity is specified, an error will occur.

      Parameters

      • moveSpeedRate: number

        Movement speed multiplier

      Returns void

    • Sets a one-shot effect that changes the position of participants who touch the item.

      If the position contains NaN, Infinity, or -Infinity, an error will occur.

      Parameters

      • position: Vector3

        The destination of the avatar's root position, corresponding to the bottom center of the avatar's feet (global coordinates)

      Returns void

    • Beta

      Sets a continuous effect that applies PostProcessEffects to participants in the range. When a participant leaves the range, this effect is no longer applied to the participant.

      If null is specified, an error will occur. To clear the effect, use OverlapEffect.clearPostProcessEffects.

      Parameters

      Returns void

    • Sets a one-shot effect that changes the rotation of participants who touch the item. The body orientation will stay vertical, and only the y-axis rotation is applied.

      If the rotation contains NaN, Infinity, or -Infinity, an error will occur.

      Parameters

      • rotation: Quaternion

        The rotation of the participant (global coordinates)

      Returns void