Skip to main content

RideRenderDistancePlugin

Optimizes "rendering" of the animation model by checking the distance from the character. See ModelAnimationPlayer and AnimationModel for how model is rendered when canUpdateModel is false. (Basically positions the model underneath the map as default) It is recommended that you disable this plugin when a player sits down in the ride train/model and reenable it when they get off.

Functions

new

Constructor
RideRenderDistancePlugin.new(
modelAnimPlayerModelAnimationPlayer,
renderDistancenumber?--

Defaults to 0

) → RideRenderDistancePlugin

setIsEnabled

RideRenderDistancePlugin:setIsEnabled(valueboolean) → ()

Sets if the plugin is enabled or not. While disabled and plugin is installed on the ModelAnimationPlayer, will always setCanUpdateModel to true.

setRenderDistance

RideRenderDistancePlugin:setRenderDistance(distancenumber) → ()

Sets the distance which the animation model will be "rendered" at. If set to 0, animation model will always be rendered.

Errors

TypeDescription
Distance is not >= 0

update

RideRenderDistancePlugin:update() → ()

Updates the plugin This method is hooked up to ModelAnimationPlayer.onPreUpdated

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "",
            "params": [
                {
                    "name": "modelAnimPlayer",
                    "desc": "",
                    "lua_type": "ModelAnimationPlayer"
                },
                {
                    "name": "renderDistance",
                    "desc": "Defaults to 0",
                    "lua_type": "number?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "RideRenderDistancePlugin"
                }
            ],
            "function_type": "static",
            "tags": [
                "Constructor"
            ],
            "source": {
                "line": 19,
                "path": "src/shared/plugins/RideRenderDistancePlugin.lua"
            }
        },
        {
            "name": "_getIsVisible",
            "desc": "Determines if the model is visible",
            "params": [],
            "returns": [],
            "function_type": "method",
            "private": true,
            "source": {
                "line": 47,
                "path": "src/shared/plugins/RideRenderDistancePlugin.lua"
            }
        },
        {
            "name": "setIsEnabled",
            "desc": "Sets if the plugin is enabled or not.\nWhile disabled and plugin is installed on the ModelAnimationPlayer,\nwill always setCanUpdateModel to true.",
            "params": [
                {
                    "name": "value",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 105,
                "path": "src/shared/plugins/RideRenderDistancePlugin.lua"
            }
        },
        {
            "name": "setRenderDistance",
            "desc": "Sets the distance which the animation model will be \"rendered\" at.\nIf set to 0, animation model will always be rendered.",
            "params": [
                {
                    "name": "distance",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "method",
            "errors": [
                {
                    "lua_type": "Distance is not >= 0",
                    "desc": ""
                }
            ],
            "source": {
                "line": 113,
                "path": "src/shared/plugins/RideRenderDistancePlugin.lua"
            }
        },
        {
            "name": "update",
            "desc": "Updates the plugin\nThis method is hooked up to ModelAnimationPlayer.onPreUpdated",
            "params": [],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 121,
                "path": "src/shared/plugins/RideRenderDistancePlugin.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "RideRenderDistancePlugin",
    "desc": "Optimizes \"rendering\" of the animation model by checking the distance from the character.\nSee ModelAnimationPlayer and AnimationModel for how model is rendered when canUpdateModel is `false`.\n(Basically positions the model underneath the map as default)\nIt is recommended that you disable this plugin when a player\nsits down in the ride train/model and reenable it when they get off.",
    "source": {
        "line": 11,
        "path": "src/shared/plugins/RideRenderDistancePlugin.lua"
    }
}