The default
teleportlos command teleports admins to wherever their crosshair points, but it has no awareness of water surfaces or what's actually in front of you. Better Line Of Sight Teleport replaces it with a smarter version that scans along the line of sight, snaps to nearby vehicles and entities like Bradley Apcs, helicopters, and boats when they're in view, falls back to terrain when nothing is found, and automatically raises the destination to water level when needed.How It Works
When an admin uses theteleportlos command, the plugin casts a ray from the player's head in the direction they're looking. It divides that ray into a number of evenly spaced checkpoints (controlled by Teleport Checkpoints) and works through them one at a time:- At each checkpoint, the plugin scans a sphere of radius
Entity Detection Radiusfor any entities matching thePrioritized Entitieslist. - If a matching entity is found, the admin is teleported directly to it, no further scanning needed.
- If no matching entity is found, the plugin checks whether a terrain, world, or construction surface is hit between the current checkpoint and the next.
- If a surface is hit, the admin is teleported to that hit point.
- If nothing is hit across all checkpoints, the admin is teleported to the full extent of the ray (the maximum distance).
- After determining the destination, if the point is below the water surface, it is raised to water level.
Commands
This plugin does not add a new command. It intercepts and replaces the existingteleportlos console command, which is built into Rust and available to admins.teleportlos-- Teleports the admin toward their crosshair using the plugin's enhanced logic
Configuration
JSON:
{
"Version": "1.1.0",
"Maximum Teleport Distance (meters)": 900.0,
"Prioritized Entities (short prefab names)": [
"bradleyapc",
"patrolhelicopter",
"supply_drop",
"minicopter.entity",
"scraptransporthelicopter",
"rhib",
"rowboat",
"cargoshiptest",
"ch47scientists.entity",
"playerboat"
],
"Entity Detection Radius (meters)": 40.0,
"Teleport Checkpoints (higher = more precise)": 15,
"Enable Debug Mode": false
}
Maximum Teleport Distance-- How far along the ray the plugin looks for a destination. Admins cannot teleport further than this distance in a single usePrioritized Entities-- List of entity short prefab names that the plugin will snap to when detected along the ray. When one of these is found near a checkpoint, the teleport goes directly to it instead of continuing to scan terrainEntity Detection Radius-- The radius of the sphere scanned at each checkpoint when looking for prioritized entities. Increase this if you want the plugin to detect entities that aren't directly in the line of sightTeleport Checkpoints-- How many evenly spaced points the ray is divided into. More checkpoints means finer terrain detection and more accurate entity snapping, but slightly more work per command useEnable Debug Mode-- When set totrue, draws visual markers in-world showing the ray, each checkpoint sphere, and the final teleport destination. Useful for understanding how the plugin is resolving a teleport. Visible only to the admin who used the command