Skip to content

thatSoftwareEngineer/TeleportAnimation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

GTA-Style Teleport Animation (Utility)

This is a simple utility you can copy into your Paper/Spigot plugin to add a cinematic, GTA-style teleport effect for players. Itโ€™s not a standalone plugin or full API just a class you can reuse.


โœจ What It Does

  • Smoothly moves the playerโ€™s camera in 3 stages:

    1. Rises up to a high point.
    2. Slides horizontally to the destination.
    3. Descends to the target Y level.
  • Uses ease-in-out quadratic motion for smoothness.

  • Teleports the player to the destination at the end.

  • Temporarily switches them into Spectator mode, then restores their gamemode.


๐Ÿ“ฆ How To Use

  1. Copy Camera.kt (and supporting enums/utilities) into your pluginโ€™s source.
  2. Call the MoveCameraTask directly when you want to animate a teleport:
// Example usage
val destination = Location(Bukkit.getWorld("world2"), -734.0, 113.0, 1449.0, 0f, 90f)

player.gameMode = GameMode.SPECTATOR
Camera.CameraCommand.MoveCameraTask(
    player,
    destination,
    player,
    TeleportAnimation.instance
).runTaskTimer(TeleportAnimation.instance, 0, 1)
  1. The task will run automatically and complete the cinematic teleport.

๐Ÿ“‹ Requirements

  • Paper/Spigot 1.20+
  • Java 17+
  • Kotlin (if your plugin is written in Kotlin)

๐Ÿ”ง Notes

  • Designed as a drop-in util โ€” no config, no commands needed.

  • You can tweak values inside MoveCameraTask:

    • highPoint โ†’ how high the camera rises
    • duration โ†’ speed of each stage
    • epsilon โ†’ threshold for ending a stage

๐Ÿš€ Possible Extensions

  • Add fade-to-black transitions.
  • Support Player#setCamera instead of Spectator mode (Paper 1.20.5+).
  • Configurable easing functions for different cinematic feels.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages