Skip to content

Instantly share code, notes, and snippets.

@VariableVixen
Created June 14, 2025 20:02
Show Gist options
  • Save VariableVixen/527ba8f547bba85ac9db30245d020a2c to your computer and use it in GitHub Desktop.
Save VariableVixen/527ba8f547bba85ac9db30245d020a2c to your computer and use it in GitHub Desktop.
Core Keeper - Teleport to anywhere at anytime - SCRIPT FIX
using Unity.Mathematics;
using Unity.Transforms;
using Pug.UnityExtensions;
using HarmonyLib;
[HarmonyPatch]
class teleportmod {
[HarmonyPrefix, HarmonyPatch(typeof(MapMarkerUIElement), "OnLeftClicked")]
public static bool OnLeftClicked(MapMarkerUIElement __instance) {
if (__instance.markerType == MapMarkerType.Portal ||
__instance.markerType == MapMarkerType.Waypoint ||
__instance.markerType == MapMarkerType.PlayerGrave ||
__instance.markerType == MapMarkerType.Ping ||
__instance.markerType == MapMarkerType.Unique ||
__instance.markerType == MapMarkerType.UserPlacedMarker)
{
PlayerController playerController = Manager.main.player;
float2 rhs = EntityUtility.GetObjectData(__instance.mapMarkerEntity, __instance.world).variation == 20
? new float2(1f, 1f)
: new float2(1f, -0.25f);
playerController.QueueInputAction(new UIInputActionData {
action = UIInputAction.Teleport,
position = EntityUtility.GetComponentData<LocalTransform>(__instance.mapMarkerEntity, __instance.world).Position.ToFloat2() + rhs
});
if (Manager.ui.isShowingMap) {
Manager.ui.OnMapToggle();
}
}
return false;
}
}
@VariableVixen
Copy link
Author

Until the author updates the mod.io version, you can download this file and overwrite the original. I don't play Core Keeper on linux, but on windows the path is C:\Users\Public\mod.io\5289\mods\4464472_5741032\Scripts\TeleportMod.cs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment